You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a script tries to daemonize to perform a long running action, it should have the chance to handle errors via exceptions prior to the forking of the child.
Currently if there is already a daemon running so the parent can't get a lock on the pid file Daemonize.start() just exits. As an option at least it should just raise an exception which can be more gracefully handled in the main script.
The text was updated successfully, but these errors were encountered:
We've decided that we will raise exceptions on every error, instead of exiting silently (or sometimes printing something to the logger). This will be implemented in the nearest future. This issues will be updated with the progress.
As for now, to mitigate your issue, you can try to catch SystemExit.
I realise this is almost 3 years ago, but did this ever happen? It looks like the current version still terminates the application when something goes wrong, or once the parent has spawned the child, which feels very much incorrect! It also makes the library impossible to write unit tests for, as it keeps terminating mid-way through the tests.
I had working changes, but they were done at a previous company and I never sought authorization to release the change since @thesharp said the project had a different approach for a fix.
When a script tries to daemonize to perform a long running action, it should have the chance to handle errors via exceptions prior to the forking of the child.
Currently if there is already a daemon running so the parent can't get a lock on the pid file Daemonize.start() just exits. As an option at least it should just raise an exception which can be more gracefully handled in the main script.
The text was updated successfully, but these errors were encountered: