Is there any way to list systemd services in linux "in-the-order-of" they were loaded?

user3128488 picture user3128488 · Mar 27, 2015 · Viewed 9.2k times · Source

I am trying to understand the dependencies between different systemd services in my new project. We are using yocto build system and systemd/system services.

If I perform,

systemctl -l

It will list all the services in alphabetic order. But I am specifically looking for any commands/scripts that can be used for listing systemd services "in-the-order-of" they were loaded.

Please help.

Answer

shibley picture shibley · Mar 27, 2015

Unfortunately, due to the parallel nature of the boot up process and the potentially complex dependency relationships among services, the service start up order isn't very deterministic. However, systemd-analyze, if present on your system, can graphically plot the start up order of services:

systemd-analyze plot > startup_order.svg

It can also be used to graphically plot service dependencies:

systemd-analyze dot | dot -Tsvg > systemd.svg