0

I have a typical problem.

I was working on server configuration for rails using nginx and passenger. how ever i have installed the nginx passenger module.

then i configured correctly the nginx at /opt/nginx/conf directory.

Then when i try to restart/strat/reload/stop it says: Restarting nginx: /etc/init.d/nginx: line 42: start-stop-daemon: command not found.

My restart config is at /etc/init.d/nginx and there i have

restart|force-reload)
    echo -n "Restarting $DESC: "
    start-stop-daemon --stop --quiet --pidfile \
            /opt/nginx/logs/$NAME.pid --exec $DAEMON
    sleep 1
    start-stop-daemon --start --quiet --pidfile \
            /opt/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
    echo "$NAME."
    ;;

i am working on centos. please help me i cant figured it out why its happening. Thanks.

4

1 回答 1

1

在不知道第 42 行在哪里的情况下,我认为您的问题是您实际上是在将--exec $DAEMON参数与参数一起传递--stop。到目前为止,在我编写的所有初始化脚本中,我都使用start-stop-daemon --stop --quiet --pidfile ${PIDFILE} --name ${NAME}where${NAME}只包含可执行文件的名称(在我们的例子中nginx)。不知道这是否是您的问题,不知道这是否是第 42 行中的问题。错误消息听起来好像根本找不到start-stop-daemon(这不太可能)。

于 2013-10-29T17:11:48.353 回答