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 4BObG+EcVGBcRQAA0tVLHw (envelope-from ) for ; Fri, 19 Mar 2021 03:39:13 +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 MMliF+EcVGAQWAAAB5/wlQ (envelope-from ) for ; Fri, 19 Mar 2021 03:39:13 +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 7CDA12550B for ; Fri, 19 Mar 2021 04:39:12 +0100 (CET) Received: from localhost ([::1]:43498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lN5yh-0001tu-0n for larch@yhetil.org; Thu, 18 Mar 2021 23:39:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lN5yY-0001s1-CE for bug-guix@gnu.org; Thu, 18 Mar 2021 23:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lN5yY-0007m1-4P for bug-guix@gnu.org; Thu, 18 Mar 2021 23:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lN5yY-0006ri-2S for bug-guix@gnu.org; Thu, 18 Mar 2021 23:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47253: network-manager shepherd services does not wait to be online Resent-From: raid5atemyhomework Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 19 Mar 2021 03:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47253 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 47253@debbugs.gnu.org X-Debbugs-Original-To: "bug-guix@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.161612511026334 (code B ref -1); Fri, 19 Mar 2021 03:39:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Mar 2021 03:38:30 +0000 Received: from localhost ([127.0.0.1]:48415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lN5y1-0006qf-Rj for submit@debbugs.gnu.org; Thu, 18 Mar 2021 23:38:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:44454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lN5y0-0006qX-4N for submit@debbugs.gnu.org; Thu, 18 Mar 2021 23:38:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lN5xy-0001bc-6q for bug-guix@gnu.org; Thu, 18 Mar 2021 23:38:27 -0400 Received: from mail-40132.protonmail.ch ([185.70.40.132]:37989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lN5xv-0007OT-Fd for bug-guix@gnu.org; Thu, 18 Mar 2021 23:38:25 -0400 Date: Fri, 19 Mar 2021 03:38:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1616125100; bh=bInF8QjigW6r/QI4gHGo0f2y6wdnWprDXgifF4EoGI4=; h=Date:To:From:Reply-To:Subject:From; b=N/ySH2IMsxynW5Xpp/5noQTpcRA5DJ0nST971AqmRBUZZnpmDfbGKmuuWilD3wYWU pF0zk6kAo2XPAvVaQctgdOiGKy/IyElZFvFbZyq5SpjgzLfYfFF0E25+yov6OUeQUT J3H144SjJDGMszIf+JY4fqRkwNf7hNfsMAMXVVOg= Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.132; envelope-from=raid5atemyhomework@protonmail.com; helo=mail-40132.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Reply-to: raid5atemyhomework X-ACL-Warn: , raid5atemyhomework From: raid5atemyhomework via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616125152; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=bInF8QjigW6r/QI4gHGo0f2y6wdnWprDXgifF4EoGI4=; b=JcUIOkL2sku8vO/ujQvoWQYSBEQohxDPTlQDH0QB3/TBJdjuuZu7D3EGgQX0s0dM4l8Jg6 XVo/Q2yYhiIJx5eKRZC0IpM9/1E8d7QoV+K3zCKfhOQC15fufvwhPE+D/QOK+ZDEz08Ccx CDraRI+t6Rx3pF5f6Kjawd8FoSwJb8JGsXRa6+1ggytLSQBH4XwfmMnMoNmY+a3duH/5Tx YpGpQlGL8efQEX9dxYSwN+6mB0b/DDjiSHLQJfIXhVZq1LW4cXEe/pdeoIy7mE0CKvJzbj Vrlsmu0lpWnyeiZXlhYaEf8iU4BbX+w3ht4UY8IsuIVdWVCVSHDJ1W2YEDRa9A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616125152; a=rsa-sha256; cv=none; b=KmK6627oOyxrQFO+fZhbJSFxrqqSZvywgJHdsdXOZMzeX/SB96++URvJlReNkQOiMWc1f+ ljdj7nsmTP5xNTJRiocHYJorUlsWFAltilUMoqJCQD8zRRJhlDWCphZ6BZwwCe739b/BDZ Ho1yzJNBuNOJsOtuyzlzfgoRbAi7Ykbzv86/DAoLdZ7THyhgfEpR0uwz4UbfHNQlVrF53g 8W0fa/BPrIYutYCnd6Jf15Gkhw6l/HRefaXlPpveMNjBCOmTELKirbPaPpkentcKlmKjHr jw9aW4biGfJZjBIK4a5UhjDPF7/EC88Tqk2At9EMqT1xRmbg8Kb2rRhegPwTfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail header.b="N/ySH2IM"; 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.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail header.b="N/ySH2IM"; dmarc=pass (policy=none) header.from=gnu.org; 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: 7CDA12550B X-Spam-Score: -2.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: NzaNnytPP77d 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 acce= ss the network at startup. One daemon dies (and gets respawned so often th= at it sometimes gets disabled by Shepherd), the other daemon just keeps run= ning 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 fai= rly bad since I want to be able to leave this server alone and have it surv= ive power interruptions etc. Checking on other systems, I stumbled on this file on SystemD-based systems= : ```systemd [Unit] Description=3DNetwork Manager Wait Online Documentation=3Dman:nm-online(1) Requires=3DNetworkManager.service After=3DNetworkManager.service Before=3Dnetwork-online.target [Service] Type=3Doneshot ExecStart=3D/usr/bin/nm-online -s -q --timeout=3D30 RemainAfterExit=3Dyes [Install] WantedBy=3Dnetwork-online.target ``` Searching the Guix source code, I can't find any `nm-online` command. So I= think that, when using the `network-manager` service type, the `networking= ` provision is considered started even though networking isn't actually onl= ine yet. 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 loo= pback)) - (start #~(make-forkexec-constructor - (list (string-append #$network-manager - "/sbin/NetworkManager") - (string-append "--config=3D" #$conf) - "--no-daemon") - #:environment-variables - (list (string-append "NM_VPN_PLUGIN_DIR=3D" #$vpn - "/lib/NetworkManager/VPN") - ;; Override non-existent default users - "NM_OPENVPN_USER=3D" - "NM_OPENVPN_GROUP=3D"))) + (start #~(let ((constructor (make-forkexec-constructor + (list (string-append #$netwo= rk-manager + "/sbin/= NetworkManager") + (string-append "--conf= ig=3D" #$conf) + "--no-daemon") + #:environment-variables + (list (string-append "NM_VPN= _PLUGIN_DIR=3D" #$vpn + "/lib/N= etworkManager/VPN") + ;; Override non-existe= nt default users + "NM_OPENVPN_USER=3D" + "NM_OPENVPN_GROUP=3D")= ))) + (lambda args + (let ((pid (apply constructor args))) + (invoke/quiet (string-append #$network-manage= r "/bin/nm-online") + "-s" "-q" "--timeout=3D30") + pid)))) (stop #~(make-kill-destructor)))))))) (define network-manager-service-type ``` Of course, the big problem is that Shepherd is single-threadded and `nm-onl= ine` will block all other bootup.