all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: raid5atemyhomework <raid5atemyhomework@protonmail.com>,
	47253@debbugs.gnu.org
Subject: bug#47253: network-manager shepherd services does not wait to be online
Date: Fri, 19 Mar 2021 08:07:44 -0400	[thread overview]
Message-ID: <87r1kbmjmc.fsf@netris.org> (raw)
In-Reply-To: <PdivRceeZdWO61FRE9ZHSeRqlynUianTTWX-t15FaDI2eWjZ-wMnfl7mQwz6tfvCcky2lCugWsvlpFw9jRI1u0ZPOueJXGA-MxxrmX1SRLk=@protonmail.com>

Hi,

raid5atemyhomework via Bug reports for GNU Guix <bug-guix@gnu.org>
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




  reply	other threads:[~2021-03-19 12:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19  3:38 bug#47253: network-manager shepherd services does not wait to be online raid5atemyhomework via Bug reports for GNU Guix
2021-03-19 12:07 ` Mark H Weaver [this message]
2021-03-19 16:03   ` raid5atemyhomework via Bug reports for GNU Guix
2021-03-20  8:07     ` Mark H Weaver
2021-03-20 10:15       ` raid5atemyhomework via Bug reports for GNU Guix
2021-07-23 15:27         ` raid5atemyhomework via Bug reports for GNU Guix
2021-07-24 11:56           ` Bone Baboon via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1kbmjmc.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=47253@debbugs.gnu.org \
    --cc=raid5atemyhomework@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.