Comment 1 for bug 1033856

Revision history for this message
Channel4 (channel4) wrote :

Hello all,

The retry needs a parameter (in example I have said 5 seconds)... in both stop and restart|force-reload case statements.

In the restart|force-reload the --pidfile argument does not have the pid location (instead it have retry argument)

Will work:

/etc/init.d/nginx

...

        stop)
                echo -n "Stopping $DESC: "
                start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --retry 5 \
                        --exec $DAEMON || true
                echo "$NAME."
                ;;

        restart|force-reload)
                echo -n "Restarting $DESC: "
                start-stop-daemon --stop --quiet --pidfile \
                    /var/run/$NAME.pid --retry 5 --exec $DAEMON || true
                sleep 1
                test_nginx_config
                # Check if the ULIMIT is set in /etc/default/nginx
                if [ -n "$ULIMIT" ]; then
                        # Set the ulimits
                        ulimit $ULIMIT
                fi
                start-stop-daemon --start --quiet --pidfile \
                        /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true
                echo "$NAME."
                ;;

Thanks,

Chris