News for hackers. Stuff that matters.
Re:A simple Unix daemon in Python by jrockway on Thursday July 31, 2008 @09:21AM (#262921)
Something that bugs me about Python is that code like this is distributed on random blogs instead of on some central repository like the CPAN. It's a shame to make people cut-n-paste code into their applications.

Also, I'm conflicted on whether or not I would want to globally change the behavior of a process in a class. setsid, "close STDIN", etc. affect the entire process, not just an instance of the class.

I prefer the Perl approach:

http://search.cpan.org/~ehood/Proc-Daemon-0.03/Daemon.pm

At least it's clear that the entire process is affected.

Re:A simple Unix daemon in Python by jcl on Thursday July 31, 2008 @10:15AM (#262967)
OK, the Python Package Index is not quite the same thing as CPAN, but it's at least a little better than random blogs:

http://pypi.python.org/pypi?%3Aaction=search&term=daemon...

Re:A simple Unix daemon in Python by bcostlow on Thursday July 31, 2008 @01:49PM (#263244)
There's no reason you can't do this 'classless' in Python.

I've seen similar Python code that takes the Perl approach, as well as code where the 'daemonizer' is a function that takes a function (which is the main event loop of the daemon) as an argument.

In this case it's a design, not a language decision.

Re:A simple Unix daemon in Python by jrockway on Friday August 01, 2008 @01:22AM (#263781)
There's no reason you can't do this 'classless' in Python.

Sure. At that point in my comment, I was no longer comparing languages, and merely commenting on the implementation of the linked article.