-
Notifications
You must be signed in to change notification settings - Fork 12
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
Can't start killed process #12
Comments
What signal did you use to kill the process? |
SIGKILL |
Ah, yeah. SIGKILL terminates the process without allowing it to run the cleanup logic. It's a known shortcoming of using signal trapping to perform pidfile cleanup. I think something like psutils would be a good alternative. I'm trying to keep the project dependency free so I will likely make psutils an optional driver for pid management. Is using SIGKILL a requirement for your project? If not you should consider using another signal such as SIGTERM as it will properly tigger the cleanup logic and remove the pidfile. |
it's not a secret
it would be great
I think that this is possible as the external impact |
The problem isn't just if the daemon is killed. The same issue happens if it dies unexpectedly. Or the host system crashes or loses power. Or any number of other possibilities. That is why full pidfile handling needs to test that the pid is valid. I need to test portability of the method, but on POSIX systems, there is no need for external dependencies. It's as easy as something like
Windows supports os.kill in 2.7 onwards. I'll see if it works there. |
The code as it stands doesn't work on Windows for a number of unrelated reasons. As such, I already have a fix (plus tests) for the pidfile handling in my clone. I'll submit a pull request. |
Thanks to @tenortim I can finally close this bug! |
When I killed daemon process "python ShowMe.py" from OS,
I am triyng to start it again
and getting error
but process is dead!
so, I changed in start method
to
psutil imported from https://github.com/giampaolo/psutil
The text was updated successfully, but these errors were encountered: