Created attachment 2963 [details] Fix for SIGTERM handling in daemon mode I am running bitbake-prserv in daemon mode and noticed that it does not exit when a SIGTERM is sent to it. Using "bitbake-prserv --stop" works fine, but sending a SIGTERM to the pid of the daemonized bitbake-prserv hungs it and then even a "bitbake-prserv --stop" is not able to stop it. The problem seems to be that the handler thread is not signaled to quit, so it stays there doing its work, as it is not a daemon thread (i.e. the python thread is created in non-daemon mode). The attached patch fixes this by setting the quit variable instead. The patch also does not raise the SystemExit exception any longer but instead leaves the quit flag to do its job and do a clean exit. This way the PID file is properly removed.
Thanks for the patches! http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=abf8a8fbc35c8d45c2357701400477792e39f80e