6

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

S.R.
  • 373
  • 1
  • 7
  • 16

1 Answers1

8

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.
Byte Commander
  • 107,489
  • Thanks, but I'm not sure. It is a very short list... When I put --after instead, it becomes a very long list. I have disabled the service, as it was causing a long boot delay, and now I'm trying to see which service might suffer from this decision. – S.R. Aug 12 '17 at 20:45
  • 1
    Note that --after shows all other units that specified to start the mentioned one after themselves. You are either looking for --reverse or maybe --before, which shows all units before which the mentioned one needs to be started. – Byte Commander Aug 12 '17 at 20:51
  • Yes, --before could be it. It's good to see that services which should be started after that service are still started somehow even when it is disabled. Thanks! :) – S.R. Aug 12 '17 at 21:00