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.
About linux : can-a-systemd-service-depends-on-a-remote-systemd-service-on-linux
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:
- In Host1; Start the ServiceA
- 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.
- 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)
- Add a cronjob fits the time for the script above.
- If you have a workflow management/orchestration server you can use it.
- With webhooks.
- Automation solutions like Jenkins