Package: nginx-common
Severity: normal

When runing nginx -t then process creates pid file and doesn't remove it
if his size is 0. Through this I can't run process nginx as
a different user (start-stop-daemon -c):

# /etc/init.d/nginx.orig start
Starting nginx: nginx.

nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (13: Permission
denied)

My suggestion to get rid of this error:

@nx.orig nginx 
--- nginx.orig  2012-12-04 12:35:09.000000000 +0100
+++ nginx       2012-12-04 12:31:40.000000000 +0100
@@ -26,25 +26,27 @@
 
 . /lib/lsb/init-functions
 
+PID=$(awk -F'[ ;]' '/[^#]pid/ {print $2}' /etc/nginx/nginx.conf)
+
@ -32,12 +32,12 @@
 #fi
 
 test_nginx_config() {
-       if $DAEMON -t $DAEMON_OPTS >/dev/null 2>&1; then
-               return 0
-       else
-               $DAEMON -t $DAEMON_OPTS
-               return $?
-       fi
+    $DAEMON -t $DAEMON_OPTS 
+    retvar=$?
+    if [ ! -S "$PID" ]; then
+        rm -f $PID
+    fi
+    return $retvar
 }
 
 case "$1" in

-- System Information:
Debian Release: 6.0.6
  APT prefers weii-stable
  APT policy: (1001, 'weii-stable'), (990, 'stable'), (70, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to pl_PL.UTF-8)
Shell: /bin/sh linked to /bin/bash


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to