HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Nginx doesnīt start without any output (http://www.howtoforge.com/forums/showthread.php?t=62072)

cyprus 3rd June 2013 18:31

Nginx doesnīt start without any output
 
I run a LEMP System on a Hetzner Server with Debian Squeeze and after some challenges, it worked without many problems.
But yesterday I ran into a problem.
I ran an upgrade of some progs and after the upgrade the apache and nginx seems to bee off. So I turned Apache off and tried to start nginx.
without any output:
This is my test:
Quote:

root@squeeze:~# fuser -n tcp 80
root@squeeze:~# /etc/init.d/nginx
root@squeeze:~# /etc/init.d/nginx stop
root@squeeze:~# /etc/init.d/nginx start
root@squeeze:~# ps auxw | grep nginx
root 23148 0.0 0.0 7548 860 pts/0 S+ 17:34 0:00 grep nginx
root@squeeze:~# killall nginx
nginx: no process found
root@squeeze:~# killall -9 nginx
nginx: no process found
I checked the log files but couldnīt find any significant.
Tried this:
Quote:

root@squeeze:~# sh -x /etc/init.d/nginx start
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+ DAEMON=/usr/sbin/nginx
+ NAME=nginx
+ DESC=nginx
+ [ -f /etc/default/nginx ]
+ . /etc/default/nginx
+ test -x /usr/sbin/nginx
+ exit 0
Now I ran out of ideas and searching the web didnīt help me.
Thanx in advance for any hint
Cyprus

falko 4th June 2013 18:30

Take a look at /etc/init.d/nginx and try to find out where it may possibly exit; then perform the same checks on the command line. That way you should be able to find out where and why the init script stops.

cyprus 4th June 2013 22:58

It looks quite common to me :

Quote:

#!/bin/sh

### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/nginx
NAME=nginx
DESC=nginx

# Include nginx defaults if available
if [ -f /etc/default/nginx ]; then
. /etc/default/nginx
fi

test -x $DAEMON || exit 0

set -e

. /lib/lsb/init-functions

PID=$(awk -F'[ ;]' '$1 !~ /^#/ && /pid/ {print $2}' /etc/nginx/nginx.conf)
if [ -z "$PID" ]
then
PID=/run/nginx.pid
fi

# Check if the ULIMIT is set in /etc/default/nginx
if [ -n "$ULIMIT" ]; then
# Set the ulimits
ulimit $ULIMIT
fi

test_nginx_config() {
set +e
OUTPUT=`$DAEMON -t $DAEMON_OPTS 2>&1`
retvar=$?
if [ $retvar -ne 0 ]
then
echo "Configuration test failed!" >&2
echo -n "$OUTPUT\n"
exit $retvar
fi
set -e
}

start() {
start-stop-daemon --start --quiet --pidfile $PID \
--retry 5 --exec $DAEMON --oknodo -- $DAEMON_OPTS
}

stop() {
start-stop-daemon --stop --quiet --pidfile $PID \
--retry 5 --oknodo --exec $DAEMON
}

case "$1" in
start)
test_nginx_config
log_daemon_msg "Starting $DESC" "$NAME"
start
log_end_msg $?
;;

stop)
log_daemon_msg "Stopping $DESC" "$NAME"
stop
log_end_msg $?
;;

restart|force-reload)
test_nginx_config
log_daemon_msg "Restarting $DESC" "$NAME"
stop
sleep 1
start
log_end_msg $?
;;

reload)
test_nginx_config
log_daemon_msg "Reloading $DESC configuration" "$NAME"
start-stop-daemon --stop --signal HUP --quiet --pidfile $PID \
--oknodo --exec $DAEMON
log_end_msg $?
;;

configtest|testconfig)
log_daemon_msg "Testing $DESC configuration"
if test_nginx_config; then
log_daemon_msg "$NAME"
else
exit $?
fi
log_end_msg $?
;;

status)
status_of_proc -p $PID "$DAEMON" nginx
;;

*)
echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest}" >&2
exit 1
;;
esac

exit 0
I get no result careless wich command I try.

Thanx for further hints


All times are GMT +2. The time now is 20:13.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.