Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1311  / 3 Years ago, mon, august 16, 2021, 11:17:01

I am working on a package that needs two Upstart jobs: one that launches a daemon, and another that launches a supporting daemon if the configuration file requires it. The logic to determine if the supporting daemon should be launched involves processing the configuration file with sed and friends, which causes problems with Upstart's daemonization detection (Upstart has no way to distinguish PIDs), so expect fork and expect daemon aren't useful. Unfortunately, this means Upstart detects the first invocation of sed as the first PID, and immediately starts the main job, before the supporting daemon is fully initialized. This frequently leads to the premature termination of the main job, due to an improperly configured environment.



Is there any way to prevent Upstart from starting the main job too soon in this scenario?



expect stop looks like it's close to what I need, but I don't see a way to raise that signal without terminating one of the daemons, neither of which generate the SIGSTOP signal on their own.


More From » upstart

 Answers
3

The solution to this ended up being in the Upstart documentation:




Create a post-start section that performs some check and only returns once the service is "ready".



[#36899] Wednesday, August 18, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
thellfi

Total Points: 222
Total Questions: 103
Total Answers: 123

Location: Palau
Member since Mon, Aug 16, 2021
3 Years ago
thellfi questions
;