我已经创建了一个名为watch_folder.conf的upstart conf脚本,我已经成功地在几个ubuntu安装上使用了但由于某种原因我从以下代码中收到错误:
#/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
如果我查看/var/log/upstart/watch_folder.log,我会看到以下内容
/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
...
是否有人知道可能导致此错误的原因,令我困惑!
答案 0 :(得分:0)
我似乎误解了upstart配置文件的结构,例如script
,chdir
是一个节,所以不应该出现在一个节内。
此处有更多信息
https://askubuntu.com/questions/321867/upstart-service-giving-chdir-command-not-found-error#321871