Systemd – How to List All Services That Start After a Certain Service

systemd

I would like to find in this way (if possible) which services wait for NetworkManager-wait-online.service to execute before they start?

Best Answer

I think the command you are looking for is:

$ systemctl list-dependencies --reverse NetworkManager-wait-online.service 
NetworkManager-wait-online.service
● └─network-online.target
●   └─hddtemp.service

From man systemctl:

   list-dependencies [NAME]
       Shows units required and wanted by the specified unit. This
       recursively lists units following the Requires=, Requisite=,
       ConsistsOf=, Wants=, BindsTo= dependencies. If no unit is
       specified, default.target is implied.

       By default, only target units are recursively expanded. When --all
       is passed, all other units are recursively expanded as well.

       Options --reverse, --after, --before may be used to change what
       types of dependencies are shown.

   --reverse
       Show reverse dependencies between units with list-dependencies,
       i.e. follow dependencies of type WantedBy=, RequiredBy=, PartOf=,
       BoundBy=, instead of Wants= and similar.
Related Question