-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"svc -d . ; svc -u ." doesn't restart a service if the service doesn't exit quickly #20
Comments
Did stock daemontools get this right? |
From what I can tell, yes. This is with stock daemontools-0.76 and a service named 'int'. It seems to behave correctly:
|
As far as I can tell, this was fixed by pull #56. I am having difficulty producing a repeatable test case for this though. |
Ok, I have tried this a half dozen different ways, and I see no way to fully resolve this due to the fundamental race. At this point, This leads to a fundamental race. If the admin issues However, as far as I can tell, the problem is solved for all other cases. |
In some wrapper scripts I had to replace "svc -d .; svc -u ." with "svc -t ." since bringing a certain kind of service down and then up when the run script hasn't exited yet causes the up to be ignored.
The issue seems to be that supervise thinks it's in start mode (firstrun == 1)
and doesn't restart the service if it exited > 0.
Specifically, in supervise.c the following condition is triggered:
firstrun == 1 and wait_crashed(wstat) == 15
Repro: create a service which doesn't exit right away when running 'svc -d .; svc -u .';
svstat will show 'failed' in the status message, and the service will be left down.
The underlying problem seems to be that firstrun is set when it should not (it
should only be set if the start file exists). Maybe the following assignment
in handling 'u' in doit is wrong:
The text was updated successfully, but these errors were encountered: