From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id uK19OvUxB2SdIgEASxT56A (envelope-from ) for ; Tue, 07 Mar 2023 13:45:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eKZ5OvUxB2RqPgAA9RJhRA (envelope-from ) for ; Tue, 07 Mar 2023 13:45:41 +0100 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 BDCC3336CD for ; Tue, 7 Mar 2023 13:45:41 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678193141; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: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=B3cKRzx4iTsu1vgE7ePxhu2C99ktJDWGwr0ZA/GHRjI=; b=AyHzZPcy8UHWwp4rlrAa0Ozn/QPw/XTmj1sAifkWP1jOgbxgpPDRV6fQvlxFeSAB+jcx2k 70PFlAfp1loZ/UihgmUQRdNABXgdd28TGPUyAcinHFBHvfjTMQ96Mtr67NSaI7n29YwoWF h707NpNgRa5fW99APIrCZ8ZllZT78xBDm7o6lsi8cU4ueaRgbGHnaaTkp1BXv9zepU1kkk SQ33XJcu8Kk/63xtU3kCD+wTs5yJnCK47ecXRzhiCW5U/jM5eO0b8oTPlJd9JBJ+sIBA14 XcWp/CN/0lJHMqq22Q65WTDahz7UDwGzMMqhJsEiMmFUJmGszN4pOydzuClBZg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678193141; a=rsa-sha256; cv=none; b=TkXin7AUbJovj2zoZlRQ0SPqQczY5UBP2vQdmFFeIVbNl/dPnxXcOQX1802zIMZbPdJQma t1DN6nW3h1STX5X+ys+fWEcoqW3A4RHlvSxfpkqpKSAYv9S2+yyzNhK/CvOnP8csgzl5Lh jCUvDTdcWPAyxBwv3o9cq3Gjlwsyhv/LgWNWu8koG75hEpMglvLLVqypQbtWSLVAgGU3uN 4+Br4YsFju7EpMfEs0HjyltLImnrapdUmQ5WBxtIzkxXO4DLsbZ6Yq8Iwp+y5k4QmSohSr V1RkaqOmCtYbDBFHGjmX+/3ceGnCkr9H/LAlN02+fyj6pUZLOYsBpzXjZ0NXiw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZWgl-0001Th-TM; Tue, 07 Mar 2023 07:45:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZWgj-0001Ow-6O for guix-patches@gnu.org; Tue, 07 Mar 2023 07:45:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZWgi-0003MY-SK for guix-patches@gnu.org; Tue, 07 Mar 2023 07:45:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZWgi-0002By-LB for guix-patches@gnu.org; Tue, 07 Mar 2023 07:45:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v3 6/8] services: network-manager: Await for NetworkManager to finish starting up. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Mar 2023 12:45:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: ludo@gnu.org, Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16781930748331 (code B ref 61587); Tue, 07 Mar 2023 12:45:04 +0000 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:44:34 +0000 Received: from localhost ([127.0.0.1]:44729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWgE-0002AI-Es for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:34 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:41846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWgC-0002AA-5j for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:33 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 9A16920A6A; Tue, 7 Mar 2023 13:44:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 55B0B800B3; Tue, 7 Mar 2023 13:44:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id M17M762Bmy-I; Tue, 7 Mar 2023 13:44:20 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id AEC2B800B2; Tue, 7 Mar 2023 13:44:20 +0100 (CET) From: Bruno Victal Date: Tue, 7 Mar 2023 12:44:03 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Scanner: scn0.migadu.com X-Migadu-Queue-Id: BDCC3336CD X-Spam-Score: -1.21 X-Migadu-Spam-Score: -1.21 List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: zT+G+Afqg11d This is similar to its NetworkManager-wait-online.service systemd counterpart, with the main difference being that we handle it all in 'networking symbol, rather than introduce a new 'networking-online symbol. (see discussion #47253) As a result of this change, with opensmtpd-service-type as an example, manual 'herd restart smtpd' after system bootups are no longer required when opensmtpd is configured with a smtpd.conf containing non-loopback interfaces. (this issue is described in more detail at #60300) Fixes . * gnu/services/networking.scm (network-manager-shepherd-service): Await for NetworkManager to finish starting up. --- gnu/services/networking.scm | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 0ed467f9d8..7cf92dc8c4 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1235,17 +1235,30 @@ (define (network-manager-shepherd-service config) ;; TODO: iwd? is deprecated and should be passed ;; with shepherd-requirement, remove later. ,@(if iwd? '(iwd) '()))) - (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 + #~(lambda _ + (let ((pid + (fork+exec-command + (list #$(file-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=")))) + ;; XXX: Despite the "online" name, this doesn't guarantee + ;; WAN connectivity, it merely waits for NetworkManager + ;; to finish starting-up. This is required otherwise + ;; services will fail since the network interfaces be + ;; absent until NetworkManager finishes setting them up. + (system* #$(file-append network-manager "/bin/nm-online") + "--wait-for-startup" "--quiet") + ;; XXX: Finally, return the pid from running + ;; fork+exec-command to shepherd. + pid))) (stop #~(make-kill-destructor))))))) (define network-manager-service-type -- 2.39.1