Add the ability to run in the background with the -D or --daemon command line option.
This patch looks really ugly as diff tried matching up lines that didn't actually match. All that really happened is most of the code was indented to create the main() function.
Add support for daemonizing
Add pidfile support
Add red hat style init script
Since my python packages install from rpm, I did not realize it was a…
… different PyPi package.
I'm going to hold off on this for a bit, since i have some major changes to introduce regarding multiprocessing etc. that will definitely impact this.
Why don't you use something else to daemonize beaver? I would rather have something like init.d, supervisor, circus etc. handle the state of the beaver command than have custom code for daemonization...
Does this work on Python 2.6?
Might you be able to rebase this on top of the latest master branch? I'd like to get this out in the next beaver release if possible.
The red hat init.d functions don't have a way of backgrounding a service and expects a daemon to run in the background. There are workarounds, but having the daemon behave in an anticipated way is preferred.
It does work on 2.6 and yes, I'll rebase.
Add the ability to daemonize. Closes #79
Hey @joejulian, I added the ability to daemonize as part of a general refactor. This should work the same way as your method, except I added a bit of extra code to handle stdout to a file - was missing since it wasn't otherwise specified as a handler.
Let me know if you have any problems with it by opening a separate issue :)