From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Subject: Networking service without real-time clock Date: Tue, 25 Feb 2020 16:23:52 +0100 Message-ID: <9354FE5A-960F-4F26-9363-CE55F8DA9742@vodafonemail.de> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58382) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6c44-0001mK-3T for guix-devel@gnu.org; Tue, 25 Feb 2020 10:24:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6c41-0006gA-8Y for guix-devel@gnu.org; Tue, 25 Feb 2020 10:24:03 -0500 Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:59567) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6c41-0006bj-2F for guix-devel@gnu.org; Tue, 25 Feb 2020 10:24:01 -0500 Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id B72B259D060 for ; Tue, 25 Feb 2020 15:23:55 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [2.206.251.2]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 7B4AE5399F3 for ; Tue, 25 Feb 2020 15:23:53 +0000 (UTC) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org 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=E2=80=99s 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 =E2=80=9Ctoo big=E2=80=9D), and by this the NFS = root file system is lost. That=E2=80=99s 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 = =E2=80=9Cip=3Ddhcp=E2=80=9D 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=3D45540 [2] https://github.com/kunschikov/ld_preload_gettimeofday=