Static unit can be triggered by another unit. Is it possible to list units that can trigger specific static unit ?
1 Answer
systemctl --reverse list-dependencies nameofunit.type
shows what wants or needs that unit.
Add the --recursive
option to see the chain of unit dependencies that leads up to the specified unit.
You may need root privileges to see the entire chain.
(Source: man systemctl
)
-
I know this, but it's not working with static units as expected. eg
systemctl list-dependencies --reverse apt-daily.service
gives nothing– EdiDMar 11, 2017 at 18:51 -
Then it's likely a standalone service that is either active/enabled or called by a timer or a socket. What does
systemctl status apt-daily.service
say about it?– Mio RinMar 11, 2017 at 19:04 -
-
1Is the service enabled? If it is, then it runs on startup and checks the timer with the same name to see if it ran today and does its job if it hasn't, then goes to sleep until the timer wakes it up when it needs to run again. It is supposed to check for updates each day.– Mio RinMar 12, 2017 at 9:35
-
You are right. I didn't know that timer trigger the same unit name. I thought that triggering is somewhere in unit config file– EdiDMar 12, 2017 at 9:53