3

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. – Yu Qing Sep 5 '12 at 5:45
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.