Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've created an upstart conf script called watch_folder.conf that i have used successfully on a few ubuntu installs already but for some reason I'm getting an error from the following code:

#/etc/init/watch_folder.conf

description "watch folder service"
author      "Jonathan Topf"

start on startup

stop on shutdown

respawn
respawn limit 99 5


script
        chdir /home/jon/Dropbox/Render\ Farm\ 1/appleseed/bin
        exec /usr/bin/python ./watchfolder.py  ../../data/
        echo "watch_folder started"
end script

if I look inside /var/log/upstart/watch_folder.log i see the following

/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
...

Does anybody know what may cause this error, its perplexing me!

share|improve this question

1 Answer 1

up vote 4 down vote accepted

chdir is its own stanza. Move it from inside the script block to outside. Here's how it should probably look:

description "watch folder service"
author      "Jonathan Topf"

start on startup
stop on shutdown

respawn
respawn limit 99 5

chdir /home/jon/Dropbox/Render\ Farm\ 1/appleseed/bin

script
        exec /usr/bin/python ./watchfolder.py  ../../data/
        echo "watch_folder started"
end script
share|improve this answer
    
Thank you, that fixed it –  jonathan topf Jul 19 '13 at 12:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.