[Nix-dev] multi-user.target must not be After network.target

Mathijs Kwik mathijs at bluescreen303.nl
Tue Jun 30 20:40:03 CEST 2015


I agree.

But please note that network.target doesn't do much and probably cannot
fail. It basically _starts_ networking, but does not wait for anything
to come up. Either a static ip address for an interface or _starting_
dhcpcd (without waiting for it to acquire a lease or whatever) is enough
to satisfy network.target so there probably isn't a lot to wait for
anyway.






Luca Bruno <lethalman88 at gmail.com> writes:

> The multi-user.target must be kept slim, network should not be a
> prerequisite.
> I find my server system to have systemctl show multi-user.target|grep After:
>
> After=nix-daemon.socket basic.target rescue.service rescue.target
> swap.target nss-user-lookup.target nss-lookup.target network.target
> sshd.service [various other services] systemd-user-sessions.service
> systemd-logind.service getty.target
>
> AFAIK fedora does not have network.target in After for
> multi-user.target. Neither systemd show network in any of the bootup
> diagrams. If anything goes wrong in the networking phase, the system
> might become unbootable. Whether networking works or not, the multi-user
> init should not depend on networking.
>
> There are two questions we should answer when writing services:
> 1. Is it good to run X before multi-user? Yes.
> 2. Is it necessary to run X before multi-user? No.
>
> Choose the latter. Is it necessary to run network before multi-user? No,
> in most cases.
>
> If you have any case where it's really necessary, please explain here,
> otherwise I will go deep in eliminating this hard dependency.
>
> Where can this be a problem? Let's say there's a oneshot service that is
> After network and Before multi-user. Because by default oneshot services
> have no timeouts, if the script fails your system will not boot.
>
> Best regards,
>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list