From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QDxRCiSVVGDsEAAA0tVLHw (envelope-from ) for ; Fri, 19 Mar 2021 12:12:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sBQ1BiSVVGC2SwAAB5/wlQ (envelope-from ) for ; Fri, 19 Mar 2021 12:12:20 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 658022BA4E for ; Fri, 19 Mar 2021 13:12:19 +0100 (CET) Received: from localhost ([::1]:53606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDzF-0006VI-Cy for larch@yhetil.org; Fri, 19 Mar 2021 08:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDx5-0004mg-2H for bug-guix@gnu.org; Fri, 19 Mar 2021 08:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lNDx4-000130-ML for bug-guix@gnu.org; Fri, 19 Mar 2021 08:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lNDx4-0005Ty-9l for bug-guix@gnu.org; Fri, 19 Mar 2021 08:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47253: network-manager shepherd services does not wait to be online Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 19 Mar 2021 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47253 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: raid5atemyhomework , 47253@debbugs.gnu.org Received: via spool by 47253-submit@debbugs.gnu.org id=B47253.161615576821032 (code B ref 47253); Fri, 19 Mar 2021 12:10:02 +0000 Received: (at 47253) by debbugs.gnu.org; 19 Mar 2021 12:09:28 +0000 Received: from localhost ([127.0.0.1]:48987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lNDwW-0005TA-Dm for submit@debbugs.gnu.org; Fri, 19 Mar 2021 08:09:28 -0400 Received: from world.peace.net ([64.112.178.59]:57732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lNDwT-0005St-RC for 47253@debbugs.gnu.org; Fri, 19 Mar 2021 08:09:27 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNDwM-0003KU-0H; Fri, 19 Mar 2021 08:09:18 -0400 From: Mark H Weaver In-Reply-To: References: Date: Fri, 19 Mar 2021 08:07:44 -0400 Message-ID: <87r1kbmjmc.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616155939; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=LrD2eLMuYM/XB2nmvyDUCMrcNaln/zwzdOkLKyIMUZU=; b=oQHMX1X0OWdxycU9ebBCvAv+e3q1x58w6T5w9tU1vfE18/V6KrGjRwFocYbuKgY0p2k1od 8Gjy/wi2niJJwY52QAl+cHqIbx7WCXJe4gFL706l5k/wj+RdnI3OSM5tL2wRWCkLESkoW+ ANfQMmfTrEqiSrFGsz0GSaSTauIlozSSLv6rgiX/IPBJ7oUuubVVZy/HvW0FPlLEsJSbtE qbDMc+n10uFPAYqen36lkT00snWs1HGYto4A/dvubXD22qadrHN+xdoWQG538/8a7eCLkj YKSxjzyGP1EKTR7LzX7NbwQEl6vvb0uUcwFljteaicdzfi1F14fYBvkxndVDEA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616155939; a=rsa-sha256; cv=none; b=fFWH3LIczTF2y8+1irU50jNaXAAYUlTssgDeC6/KiCn9uZHYl1sDBF2Q5BwIqOYy8mwSX2 JJSoK4j9wZ0+byD/kfhJbOZhvhuJ2b/7KMsGI5tLSAfFla9CJYEDTXHN5nzD1wlFL0IRg/ s1vYYe7m+lsLDHV/C+Rj3+kGsFXk22tSoyTm14ulGP6hykiCmQz9yJC2saNDNJXKpRzFYA 2/gZsYk2ik+E1hRjGsHThKoJzNl9tryaWMtkR/iW23jv3a4302Dui7RsJ150+NRpY5Dg0P n7hYn/o5lWpx6vGevEI0rpGBBwppWaN1PlU2fNYNwP9qn+1Ivtan5mj3yNiUvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.41 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 658022BA4E X-Spam-Score: -2.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: zRxaPVsCnOt4 Hi, raid5atemyhomework via Bug reports for GNU Guix writes: > I have a small number of daemons that need access to the network at > startup. I have configured their Shepherd services to require > `networking`. > > However, to my puzzlement, I consistently find that they are unable to > access the network at startup. One daemon dies (and gets respawned so > often that it sometimes gets disabled by Shepherd), the other daemon > just keeps running without having set up the server that I need it to > expose. > > Thus, in many cases whenever I reboot I have to manually `herd enable` > and `herd restart` the first daemon and `herd restart` the second. > This is fairly bad since I want to be able to leave this server alone > and have it survive power interruptions etc. [...] > I would like to propose this change: > > ```diff > --- a/gnu/services/networking.scm > +++ b/gnu/services/networking.scm > @@ -1106,17 +1106,22 @@ and @command{wicd-curses} user interfaces." > (documentation "Run the NetworkManager.") > (provision '(networking)) > (requirement '(user-processes dbus-system wpa-supplicant loopback)) > - (start #~(make-forkexec-constructor > - (list (string-append #$network-manager > - "/sbin/NetworkManager") > - (string-append "--config=" #$conf) > - "--no-daemon") > - #:environment-variables > - (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn > - "/lib/NetworkManager/VPN") > - ;; Override non-existent default users > - "NM_OPENVPN_USER=" > - "NM_OPENVPN_GROUP="))) > + (start #~(let ((constructor (make-forkexec-constructor > + (list (string-append #$network-manager > + "/sbin/NetworkManager") > + (string-append "--config=" #$conf) > + "--no-daemon") > + #:environment-variables > + (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn > + "/lib/NetworkManager/VPN") > + ;; Override non-existent default users > + "NM_OPENVPN_USER=" > + "NM_OPENVPN_GROUP=")))) > + (lambda args > + (let ((pid (apply constructor args))) > + (invoke/quiet (string-append #$network-manager "/bin/nm-online") > + "-s" "-q" "--timeout=30") > + pid)))) > (stop #~(make-kill-destructor)))))))) > > (define network-manager-service-type > ``` > > > Of course, the big problem is that Shepherd is single-threadded and > `nm-online` will block all other bootup. That's not good. For the sake of users who are not always connected to the internet, I'd strongly prefer for the Guix boot process of a desktop system to *not* be blocked for 30 seconds when there's no active internet connection. How about leaving "networking" as it is now, and instead adding a new service called "network-online" or similar, that requires "networking" and then waits until a network connection is established? What do you think? Mark