当我尝试:时stop mysite_api
,我得到:
stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.11" (uid=1000 pid=2242 comm="stop mysite_api ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
我的脚本是:
description "Mysite API Server"
author "Mysite"
start on vagrant-mounted
stop on runlevel [!2345]
respawn
script
cd /vagrant/Mysite/api
exec sudo -u vagrant python api.py
end script
答案1
这还不是答案,但我可以稍后编辑。如果你将脚本更改为以下内容,会发生什么:
description "Mysite API Server"
author "Mysite"
start on vagrant-mounted
stop on runlevel [!2345]
respawn
setuid vagrant
chdir /vagrant/Mysite/api
exec python api.py