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


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 
● └─
●   └─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, 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.

       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