5

I wrote three service units, say a.service b.service and c.service. C requires and runs after b, b requires and runs after a, so when I execute "systemctl start c.service", all three of them will be launched one by one. But when I want to stop all of them, I have to execute "systemctl stop a.service b.service c.service". Is there any other way to stop all of them with less typing?

I know with "Bindto=" I can use "systemctl stop a.service" to stop all of them, but what if I got c Bindto a and b, while a and b have no required relationship to each other?

  • 2
    And the real problem is not I want less typing, it's that as time goes by, I can't remember the name of service a and b, because they are always invoked indirectly. – tsingakbar Sep 05 '12 at 05:45

1 Answers1

4

add StopWhenUnneeded=yes to a and b is a good idea I guess.