all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: raid5atemyhomework via Bug reports for GNU Guix <bug-guix@gnu.org>
To: Mark H Weaver <mhw@netris.org>
Cc: "47253@debbugs.gnu.org" <47253@debbugs.gnu.org>
Subject: bug#47253: network-manager shepherd services does not wait to be online
Date: Fri, 19 Mar 2021 16:03:33 +0000	[thread overview]
Message-ID: <Qw8LEYPetewimqDmATAmRMsL3NFdSqxQjyMwq6bvH9WEeAeLGcRFwDb5dZ6gGXHECMhFV6NcTkrRu9K_ZS5TgX8zIFr29swilZct5lOGVaw=@protonmail.com> (raw)
In-Reply-To: <87r1kbmjmc.fsf@netris.org>

Hello Mark,

> > 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?


Ideally the `init` system should be multithreaded, such that anything that isn't dependent on `networking` does not get delayed but gets started as soon as its dependencies complete.

In particular, `transmission-daemon-service-type` creates a Shepherd service that is dependent on `networking`, but is in fact the second daemon I mentioned, which fails to properly bind to the command 9091 port, requiring the daemon to be restarted each time.  So if we use a separate `network-online` shepherd provision, `transmission-daemon-service-type` also needs to be modified (on my system I have a separate provision similar to your `network-online` idea and I wrote my own shepherd service for `transmission-daemon` just to add this requirement).

With a separate `network-online` shepherd provision we would also need to audit all the other network-requiring daemons to see if similar problems exist.

As well, `networking` is provided by multiple possible services, so if we add a separate `network-online` we also need to modify the other options.

* `network-manager-service-type`.
* `dhcp-client-service-type`.
* `wicd-service-type`.
* `connman-service-type`.

For that matter, we probably need to review the above other options, as they might just start up the networking service without actually ensuring that the networking service has actually completed.  I use `network-manager-service-type` as part of `%desktop-services` but if this issue isn't properly handled by Guix for NetworkManager then it probably isn't properly handled for the above other options --- in all likelihood the network interfaces are not available just after the networking shepherd services are started.

In addition --- do we always have a `network-online` shepherd service, or not?

* Each of the `network-manager-service-type`, `dhcp-client-service-type`, `wicd-service-type`, `connman-service-type` instantiate both a `networking` and `network-online` shepherd provision.
  * Then other network-requiring services can always assume that `network-online` exists.
  * However, not-always-online users would always find that `shepherd` completion is delayed.
    * This manifests as `herd` commands not responding until the wait-to-be-online timeout ends.
* We have separate `network-manager-online-service-type`, `dhcp-client-online-service-type`, `wicd-online-service-type`, and `connman-online-service-type` that provides the `network-online` shepherd provision to the corresponding `networking` backend.
  * Thus, not-always-online users would omit the `*-online-*` service type in order not to suffer the wait.
  * However, the user has to know to add the *corresponding* service type as well if they have to use a daemon like `transmission-daemon`.
  * Do we add `network-manager-online-service-type` to `%desktop-services`?
    * I think we should, as most `%desktop-services`-using users will be mostly online anyway, and they are the ones most likely to want to start other network-using services as well.
* We somehow implement polymorphic service types so that services like `transmission-daemon` have a `(service-extension i-need-network-online-service-type (const #f))`, which only instantiates `network-online` provision, appropriately for the network backend, if at least one service requires it.
  * Probably a lot more code and design and nerd wars about the best possible design and delays and ...

What do *you* think?


Note as well that in the SystemD case, typically, `NetworkManager-wait-online.service` is always enabled, and when I boot up my system on SystemD-based OSs even without any network available I don't experience any network-going-up delays during boot (at least in the last few years, I do remember circa oughts Ubuntu having that problem).

In addition, `nm-online -s` has this:

>       -s | --wait-for-startup
>           Wait for NetworkManager startup to complete, rather than waiting for network connectivity specifically. Startup is considered complete once NetworkManager has activated (or
>           attempted to activate) every auto-activate connection which is available given the current network state. (This is generally only useful at boot time; after startup has
>           completed, nm-online -s will just return immediately, regardless of the current network state.)

My interpretation of the above is that `-s` means that NetworkManager has *tried* to activate, not necessarily that there is an actual network connection, but I am not an expert on NetworkManager.

Thanks
raid5atemyhomework




  reply	other threads:[~2021-03-19 16: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
2021-03-19 16:03   ` raid5atemyhomework via Bug reports for GNU Guix [this message]
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='Qw8LEYPetewimqDmATAmRMsL3NFdSqxQjyMwq6bvH9WEeAeLGcRFwDb5dZ6gGXHECMhFV6NcTkrRu9K_ZS5TgX8zIFr29swilZct5lOGVaw=@protonmail.com' \
    --to=bug-guix@gnu.org \
    --cc=47253@debbugs.gnu.org \
    --cc=mhw@netris.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.