-
Notifications
You must be signed in to change notification settings - Fork 443
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
Dead pidfile on wheezy #808
Comments
Thanks for your report. This would mean that the |
Interresting, I'm a bit confused by the documentation:
That said, I'm now fairly convinced that start-stop-daemon implements SIGCHLD. However, I can't find it in the source code of dpkg for a debian wheezy container:
I see it defined, but not implemented anywhere in this source tree. Perhaps asking upstream if this has been fixed if I'm not missing anything obvious would be advised here we find something tangible ? |
Well I would be interrested how testing this looks like in their CI, I would not blame them if that kind of issue is not tested automatically yet. |
That would be great. Unfortunately the
Testing such things is hard. We aren't able to test all our stuff for native-packager as well. The test matrix of |
Jenkins uses an external, distro-independant tool to manage daemonizing: http://libslack.org/daemon/. That's a nice pattern to isolate all the pid/kill issue in a dedicated tool. This make it much easier to switch to systemd then. Just skip it :) |
You can then skip start-stop-daemon or tell it not to manage the daemon/pid file. |
Right, perhaps that's related to what @bersace explained to me on IRC, that they would be pretty "conservative" on this kind of issue.
I should probably not tell this in public, but this kind of test matrix just makes me 🚀 ➕ 💧 👖 The problem is that it's usually very hard to contribute to testing infrastructures when they're not using a modern service like travis or gitlab-ci which would easily allow such a matrix using prepared containers, it would be fast as well.
But then if the java process is SIGKILLed then a dead pidfile will remain ?
Interresting initiative, listing our options here is definitely going to help, @muuki88 would you know if the play framework also offers a feature we're missing or not using here ? |
Do you mean it make your pants wet ? 😮 |
It's the job of daemon to manage the pid file, SIGCHLD, etc. daemon is a bit like a tiny single service init service. |
I forgot to ask in the beginning. You are using play? Have you configured the |
If we don't let play do its own pid, we may end up with stale pidfiles preventing the service to start again (ie. power outage). Perhaps checking if the pidfile is valid at the top of the service file is the only way ? We could check /proc/$PID and then /proc/$PID/cmdline ? |
Confirmed the service script works as expected when we let start-stop-daemon handle the pidfile, because it overwrites stale pidfiles. Thanks a heap !!! |
no problem. You were neither the first nor will you be the last to fall in this trap. :( |
Currently, if the service is terminated with SIGKILL then the pidfile will remain on the file system, containing a dead PID. This prevents the service file to work correctly. To work around this, we added a logic like this in our deployment playbooks:
Should this be considered as a bug in the current service file ?
The text was updated successfully, but these errors were encountered: