python-daemon and upstart

Paul Rudin paul.nospam at rudin.co.uk
Sat Nov 14 11:29:55 EST 2009


Ben Finney <ben+python at benfinney.id.au> writes:

> Paul Rudin <paul.nospam at rudin.co.uk> writes:
>
>> I'm experimenting with the daemon module
>> <http://pypi.python.org/pypi/python-daemon/> and upstart
>> <http://upstart.ubuntu.com/>.
>
> First: Thank you for using ‘python-daemon’; it's getting more widespread
> use all the time, which is really helping to find all the quirks of API
> and implementation. (And good for my ego at the same time.)
>
>
Thanks for writing it.

> There's something I don't understand, which may be more of an upstart
>> issue than a python issue, but I thought I'd start by posting here.
>
> I'm unfamiliar with ‘upstart’, I hope others with more experience can
> offer more insight.
>

On Karmic it seems to be the standard way for starting and stopping
system processes.

>> Here's a test script:
> […]
>
> The program looks fine to me. What happens if you run the program,
> without getting ‘upstart’ involved?
>

As for as I can tell everything is ok invoking the script from the
command line.

>> and here's a testdaemon.conf upstart configuration:
>>
>> description "test daemon"
>> expect daemon
>> chdir /tmp
>> exec /tmp/testdaemon.py
>>
>> If I do "sudo start testdaemon" I see the "testdaemon.py" process
>> starting, and the file '/tmp/test.txt' is being written to every 5
>> seconds, so everything has kicked off. 
>
> Good to know.
>
>> The thing I don't understand is why start does not return. I guess it
>> doesn't think that the process and properly started and daemonized
>> itself? Quite possibly it's just that I don't understand this stuff
>> well...
>
> As I say, I'm completely unfamiliar with the details of ‘upstart’. Can
> you point me to whatever you used to understand it?

The man pages on Karmic - "man start" etc. and the documentation on the
upstart website: <http://upstart.ubuntu.com/> - check the getting
started page and the wiki. Also some blog pages by its author:
<http://www.netsplit.com/category/tech/upstart/>



More information about the Python-list mailing list