[systemd-devel] Boot ordering

Andrei Borzenkov arvidjaar at gmail.com
Thu Mar 19 07:10:05 PDT 2015

On Thu, Mar 19, 2015 at 4:27 PM, Christoph Pleger
<Christoph.Pleger at cs.tu-dortmund.de> wrote:
> Hello,
>>> Then, I still do not understand why my definition of a new target did
>>> not
>>> work. What is the difference between multi-user.target waiting for
>>> basic.target on the one hand and new.target waiting for basic.target and
>>> multi-user.target waiting for new.target on the other hand, aside from
>>> that one intermediate step?
>> Everything else that is ordered before multi-user.target is started
>> concurrently with your new.target.
> Hm. But I have no idea why for example gdm3 is started while my test
> script is still executing its sleep command.

Because gdm3 has no ordering dependencies against your test script so
both are scheduled to be started concurrently. Which one will be first
is more or less random.

>                                                   This is the output of
> "systemd-analyze dot | grep gdm":
>         "shutdown.target"->"gdm.service" [color="green"];
>         "shutdown.target"->"gdm.service" [color="red"];
>         "graphical.target"->"gdm.service" [color="grey66"];
>         "x-display-manager.target"->"gdm.service" [color="green"];
>         "x-display-manager.target"->"gdm.service" [color="black"];
>         "gdm.service"->"systemd-user-sessions.service" [color="green"];
>         "gdm.service"->"getty at tty7.service" [color="green"];
>         "gdm.service"->"plymouth-quit.service" [color="green"];
>         "gdm.service"->"systemd-journald.socket" [color="green"];
>         "gdm.service"->"basic.target" [color="green"];
>         "gdm.service"->"system.slice" [color="green"];
>         "gdm.service"->"basic.target" [color="black"];
>         "gdm.service"->"x-display-manager.target" [color="grey66"];
>         "gdm.service"->"system.slice" [color="grey66"];
>         "gdm.service"->"getty at tty7.service" [color="red"];
>         "gdm.service"->"plymouth-quit.service" [color="red"];
>         "gdm.service"->"shutdown.target" [color="red"];
>         "getty at tty7.service"->"gdm.service" [color="red"];
>         "plymouth-quit.service"->"gdm.service" [color="red"];
>         "plymouth-halt.service"->"gdm.service" [color="green"];
>         "plymouth-reboot.service"->"gdm.service" [color="green"];
>    Color legend: black     = Requires
>                  dark blue = Requisite
>                  dark grey = Wants
>                  red       = Conflicts
>                  green     = After
> If I understand this correctly, gdm is pulled into the boot process only
> by graphical.target, which according to target unit definitions should be
> after multi-user.target , which should be after my new.target ...

You seem to misunderstand what target does. Target simply tells
systemd "if you start me, start also these other services". Those
"other services" are started as soon as possible. Ordering of target
units has absolutely no relation to startup order of "other services".

> The only thing I can imagine what causes my problem is that Debian jessie
> does not use only systemd units, but also init scripts in /etc/rc*.d/ and
> that this brakes my desired boot order.
> Regards
>   Christoph
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

More information about the systemd-devel mailing list