我在 Ubuntu-1210-quantal-64-minimal 上使用 upstart 1.8-0ubuntu1。
它显示 nginx 正在运行,但实际上并没有。
# service nginx status
nginx start/running, process 2543
# ps -p 2543
PID TTY TIME CMD
我的配置:
# nginx
description "nginx http daemon"
author "George Shammas <[email protected]>"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/opt/nginx/sbin/nginx
env PID=/opt/nginx/logs/nginx.pid
expect fork
#respawn
#respawn limit 10 5
#oom never
pre-start script
$DAEMON -t
if [ $? -ne 0 ]
then exit $?
fi
end script
exec $DAEMON