guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Networking service without real-time clock


From: Stefan
Subject: Networking service without real-time clock
Date: Tue, 25 Feb 2020 16:23:52 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]