Score:0

Is it possible to delay a systemd service indefinitely by "After" clause?

vn flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.