unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Networking service without real-time clock
@ 2020-02-25 15:23 Stefan
  0 siblings, 0 replies; only message in thread
From: Stefan @ 2020-02-25 15:23 UTC (permalink / raw)
  To: guix-devel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-25 15:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 15:23 Networking service without real-time clock Stefan

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).