4

I have two services A and B where B is dependent on A which means in the A's service unit i have After and Requires set to B

After=B.service
Requires=B.service

Now when i stop the service B the service A also stops. And then after stopping B when i start it, the service A is not started and i have to start it manually.

systemctl stop B (A is also stopped)
systemctl start B (A is not started)
systemctl start A (I have to start A manually)

But if the service A is already stopped and i restart service B then the B and A both are started by the systemctl

systemctl stop A
systemctl restart B (B and A both are started)

My question is what is difference between start and restart for the kind of service unit i have for A?

  • You say "I have two services A and B where B is dependent on A which means in the A's service unit i have After and Requires set to B". If B is dependent on a, then B should have the Requires statement, not A. Did you mean the other way around? – etskinner Apr 26 '17 at 12:44

Your Answer

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

Browse other questions tagged or ask your own question.