启动Stop Daemon Init Debian - 无法识别的参数

时间:2014-06-13 14:30:10

标签: linux bash shell uwsgi init

这是我的debian init脚本到目前为止以emperor模式启动uwsgi:

cat <<EOF >/etc/init.d/uwsgi
#!/bin/bash
daemon="$APPVENV/bin/uwsgi"
args=( --emperor "$APPCONF/uwsgi/app.ini"
       --daemonize /var/log/emperor.log
       --emperor-pidfile "$APPDIR/emperor.pid" --gid \$(id -g "$APPUSER")
     )
pid="$APPDIR/emperor.pid"
case "\$1" in
    start)
        echo "Starting uwsgi"
        start-stop-daemon -m -p \$pid --start --exec \$daemon \$args
        ;;
    stop)
        echo "Stopping script uwsgi"
        start-stop-daemon --signal INT -p \$pid --stop \$daemon \$args
        ;;
    reload)
        echo "Reloading conf"
        kill -HUP \$(< \$pid)
        ;;
    *)
        echo "Usage: /etc/init.d/uwsgi {start|stop|reload}"
        exit 1
    ;;
esac
exit 0
EOF

chmod u+x /etc/init.d/uwsgi
update-rc.d uwsgi defaults
service uwsgi start

当我运行此命令时,我得到了这个回复:

> service uwsgi stop                                                                   
Stopping script uwsgi                                                                                 
start-stop-daemon: unrecognized option '--emperor'                                                    
Try 'start-stop-daemon --help' for more information.

但是,我知道--emperor是uwsgi完全有效的论据。那么,我是怎么回事,我把uwsgi论点放在了错误的地方?

任何帮助都将不胜感激。

0 个答案:

没有答案