• Uncategorized

About linux : can-a-systemd-service-depends-on-a-remote-systemd-service-on-linux

Question Detail

I have two services that have dependency( service A in one host need to start before service B in another host).can anybody help me pls thanx so much.

Question Answer

Host1 = Includes the ServiceA which will start first

Host2 = Includes the ServiceB which will start after ServiceA in Host1

You can build something like below in simple way:

  1. In Host1; Start the ServiceA
  2. Edit the ServiceA‘s trigger (add one if it doesn’t have or edit service program if it is possible) to scp, rsync or ftp a control file to Host2.
  3. In Host2; add a script to check if the file arrived the location and start ServiceB if the file arrived. (You can use an input inside it to doublecheck if it comes from the Host1)
  4. Add a cronjob fits the time for the script above.

Other options:

  1. If you have a workflow management/orchestration server you can use it.
  2. With webhooks.
  3. Automation solutions like Jenkins

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.