Python Daemon Subprocess not working at boot

Posted by Adam Richardson on Stack Overflow See other posts from Stack Overflow or by Adam Richardson
Published on 2010-03-19T20:18:41Z Indexed on 2010/03/19 20:21 UTC
Read the original article Hit count: 256

Filed under:
|
|
|

I am attempting to write a python daemon that will launch at boot. The goal of the script is to receive a job from our gearman load balancing server and complete the job. I am using the python-daemon module from pypi (http://pypi.python.org/pypi/python-daemon/). The nature of the job that it is completing is converting images in the orf (olympus raw image format) to jpeg. In order to accomplish this an outside program is used, ufraw in this case. The problem comes in when I start the daemon at boot, if I launch from the shell it runs perfectly and completes the work. When it starts at boot it is unable to launch the subprocess command.

commandString = '/usr/bin/ufraw-batch --interpolation=four-color --wb=camera --compression=100 --output="' + outfile + '" --out-type=jpg  --overwrite "' + infile + '"'
args = shlex.split(commandString)
process = subprocess.Popen(args).wait()

I am not sure what I am doing wrong. Thanks for any help.

© Stack Overflow or respective owner

Related posts about python

Related posts about gearman