Skip to content
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

Calling to exit() doesn't seem to work #57

Open
skewty opened this issue Oct 13, 2016 · 0 comments
Open

Calling to exit() doesn't seem to work #57

skewty opened this issue Oct 13, 2016 · 0 comments

Comments

@skewty
Copy link

skewty commented Oct 13, 2016

daemon = Daemonize(app="test_app", pid=pid, action=main, keep_fds=keep_fds)
daemon.start()
daemon.exit()  # this line is never reached because the parent process does a sys.exit(0) after the fork
daemon = Daemonize(app="test_app", pid=pid, action=main, keep_fds=keep_fds)
daemon.exit()  # raises AttributeError when self.logger is None

Since Daemon.exit() also does a sys.exit(0) any subsequent lines of code are never reached either. Shouldn't the sys.exit() calls for the original parent process be left to the user?

Shouldn't logging be initialized in init()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant