all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan <stefan-guix@vodafonemail.de>
To: guix-devel@gnu.org
Subject: Networking service without real-time clock
Date: Tue, 25 Feb 2020 16:23:52 +0100	[thread overview]
Message-ID: <9354FE5A-960F-4F26-9363-CE55F8DA9742@vodafonemail.de> (raw)

Hello Guix!

I spent some effort to have Guix System running on a Raspberry Pi 3b via NFS root filesystem. During this course I had some troubles which I need to work around.

One of this is an old bug in ISC’s dhclient, which is used by default in dhcp-client-service-type. This bug is described at [1], but probably will never be fixed.

The Raspberry Pi has no real-time clock. So during boot I use the openntpd-service-type to set the correct time. When this happens, due to the mentioned bug, dhclient thinks that it needs to renew its lease. While doing so, the currently leased IP address is dropped immediately (as the time shift was “too big”), and by this the NFS root file system is lost. That’s the end. The dhclient is not able to lease a new IP address without access to its files.

There is a kind of fix existing for this dhclient bug at [2]. It uses a linker feature to exchange the wrong use of gettimeofday() in dhclient by an implementation which uses the clock_gettime() function.

However, I solved my issue differently, not with this fix.

The DHCP server in my network uses fixed IP addresses. Therefore a renewal of a lease is not necessary and it is possible to use the “ip=dhcp” option in the kernel-arguments list. So with this there is no need for dhcp-client-service-type or static-networking-service-type.

Unfortunately, still a networking service is needed to make openntpd-service-type and other services happy. So I came up with this service definition:

(define preconfigured-networking-service-type
  (service-type (name 'preconfigured-networking)
                (extensions
                 (list (service-extension
                        shepherd-root-service-type
                        (lambda (_) (list (shepherd-service
                                           (documentation "Run an empty networking service just to satisfy other services' needs.")
                                           (provision '(networking))
                                           (start #~(const #t))
                                           (modules '())))))))
                (default-value #f)
                (description
                 "Provide an empty networking service when the IP address is preconfigured, e.g. via kernel-arguments.")))

It would be nice, if either such a kind of dummy networking could be added, or if the dhclient could be fixed. I could imagine that there are other single board computers without a real-time clock, which will suffer from the same problem.


Stefan


[1] https://bugs.isc.org/Public/Bug/Display.html?id=45540
[2] https://github.com/kunschikov/ld_preload_gettimeofday

                 reply	other threads:[~2020-02-25 15:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9354FE5A-960F-4F26-9363-CE55F8DA9742@vodafonemail.de \
    --to=stefan-guix@vodafonemail.de \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.