Currently I am working on this issue: Service 1 is on another machine. Service 2 is on this machine but need Service 1 available to function. Service 3 is on this machine but need Service 2 to function.
I want to make two automatic starting systemd service for Service 2 and Service 3.
The script to start service 2 firstly check if service 1 is available, and if not, it will be stuck in check/sleep while loop until found Service 1.
Then I want to add
After=Service_3.service
in Service_2.service
or
Before=Service_2.service
in Service_3.service
And I set Service_2.service
's type as oneshot
So will systemd indefinitely postpone starting Service 3 until Service 2 has found Service 1 available?
BTW: I do not need to restart Service 2 once it is down, for Service 3 is the High Availability program specially designed to take care of it, but it is required to run after starting Service 2.