Your message dated Tue, 18 Dec 2012 05:32:42 +0000
with message-id <[email protected]>
and subject line Bug#695374: fixed in nginx 1.2.6-1
has caused the Debian Bug report #695374,
regarding nginx.init doesn't check start-stop-daemon exit status
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
695374: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695374
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: nginx-common
Severity: important
Tags: patch

Hello,

Right now, stat-stop-daemon invokations looks like this:
-->8--
 start-stop-daemon --start --quiet --pidfile /run/$NAME.pid \
                   --retry 5 --exec $DAEMON -- $DAEMON_OPTS || true
 log_end_msg $?
-->8--

The variable $? is always 0 there and that does not depend on
start-stop-daemon's exit status.  Are you sure that broken nginx.conf
is only reason for nginx's startup failure?

Attached patch (against nginx-common.nginx.init *before* commit
60b422f38aca3295f6d4d74b6362d955cc8adb01) change things to cut off "||
true" tails.  Please, review/comment.
--- /etc/init.d/nginx.orig	2012-12-07 20:35:08.000000000 +0400
+++ /etc/init.d/nginx	2012-12-07 20:55:51.000000000 +0400
@@ -26,58 +26,66 @@
 
 . /lib/lsb/init-functions
 
+PID=$(awk -F'[ ;]' '/[^#]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() {
-	if $DAEMON -t $DAEMON_OPTS >/dev/null 2>&1; then
-		return 0
-	else
-		$DAEMON -t $DAEMON_OPTS
-		return $?
-	fi
+		$DAEMON -t $DAEMON_OPTS >/dev/null 2>&1
+		retvar=$?
+		if [ $retvar -ne 0 ]
+		then
+			exit $retvar
+		fi
 }
 
 start() {
-		test_nginx_config
-		# Check if the ULIMIT is set in /etc/default/nginx
-		if [ -n "$ULIMIT" ]; then
-			# Set the ulimits
-			ulimit $ULIMIT
-		fi
-		log_daemon_msg "Starting $DESC" "$NAME"
-		start-stop-daemon --start --quiet --pidfile /run/$NAME.pid \
-			--retry 5 --exec $DAEMON -- $DAEMON_OPTS || true
-		log_end_msg $?
+		start-stop-daemon --start --quiet --pidfile $PID \
+			--retry 5 --exec $DAEMON --oknodo -- $DAEMON_OPTS
 }
 
 stop() {
-		log_daemon_msg "Stopping $DESC" "$NAME"
-		start-stop-daemon --stop --quiet --pidfile /run/$NAME.pid \
-			--retry 5 --exec $DAEMON || true
-		log_end_msg $?
+		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)
-		log_daemon_msg "Restarting $DESC"
+		test_nginx_config
+		log_daemon_msg "Restarting $DESC" "$NAME"
 		stop
 		sleep 1
 		start
-		log_end_msg 0
+		log_end_msg $?
 		;;
 
 	reload)
-		log_daemon_msg "Reloading $DESC configuration..."
 		test_nginx_config
-		start-stop-daemon --stop --signal HUP --quiet --pidfile /run/$NAME.pid \
-			--exec $DAEMON || true
-		log_end_msg 0
+		log_daemon_msg "Reloading $DESC configuration" "$NAME"
+		start-stop-daemon --stop --signal HUP --quiet --pidfile $PID \
+			--oknodo --exec $DAEMON
+		log_end_msg $?
 		;;
 
 	configtest|testconfig)
@@ -91,15 +99,7 @@
 		;;
 
 	status)
-		status_of_proc -p /run/$NAME.pid "$DAEMON" nginx && exit 0 || exit $?
-		status=$?
-
-		if [ $status -eq 0 ]; then
-			log_success_msg "$DESC is running"
-		else
-			log_failure_msg "$DESC is not running"
-		fi
-		exit $status
+		status_of_proc -p $PID "$DAEMON" nginx
 		;;
 
 	*)

--- End Message ---
--- Begin Message ---
Source: nginx
Source-Version: 1.2.6-1

We believe that the bug you reported is fixed in the latest version of
nginx, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Kartik Mistry <[email protected]> (supplier of updated nginx package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 18 Dec 2012 10:29:18 +0530
Source: nginx
Binary: nginx nginx-doc nginx-common nginx-full nginx-full-dbg nginx-light 
nginx-light-dbg nginx-extras nginx-extras-dbg nginx-naxsi nginx-naxsi-dbg 
nginx-naxsi-ui
Architecture: source all amd64
Version: 1.2.6-1
Distribution: unstable
Urgency: low
Maintainer: Kartik Mistry <[email protected]>
Changed-By: Kartik Mistry <[email protected]>
Description: 
 nginx      - small, powerful, scalable web/proxy server
 nginx-common - small, powerful, scalable web/proxy server - common files
 nginx-doc  - small, powerful, scalable web/proxy server - documentation
 nginx-extras - nginx web/proxy server (extended version)
 nginx-extras-dbg - nginx web/proxy server (extended version) - debugging 
symbols
 nginx-full - nginx web/proxy server (standard version)
 nginx-full-dbg - nginx web/proxy server (standard version) - debugging symbols
 nginx-light - nginx web/proxy server (basic version)
 nginx-light-dbg - nginx web/proxy server (basic version) - debugging symbols
 nginx-naxsi - nginx web/proxy server (version with naxsi)
 nginx-naxsi-dbg - nginx web/proxy server (version with naxsi) - debugging 
symbols
 nginx-naxsi-ui - nginx web/proxy server - naxsi configuration front-end
Closes: 692481 693302 695374
Changes: 
 nginx (1.2.6-1) unstable; urgency=low
 .
   [ Kartik Mistry ]
   * New upstream release.
   * debian/nginx-common.nginx.init:
     + Used log_*_msg instead of echo for better init messages.
     + Added patch to check start-stop-daemon exit status, Thanks to
       Sergey B Kirpichev <[email protected]> (Closes: #695374).
   * debian/po/ja.po:
     + Added new Japanese translation. Thanks to victory <[email protected]>
       (Closes: #692481).
   * debian/po/pt_BR.po:
     + Added new Brazilian Portuguese translation. Thanks to
       Adriano Rafael Gomes <[email protected]> (Closes: #692481).
 .
   [ Cyril Lavier ]
   * debian/rules
     + Added RealIP module in nginx-naxsi (Closes: #693302).
   * debian/modules/nginx-cache-purge/
     + Updated nginx-cache-purge module with the 2.0 version.
   * debian/modules/nginx-lua/
     + Updated nginx-lua module with the 0.7.8 version.
   * debian/modules/nginx-echo/
     + Updated the nginx-echo module with the 0.41 version.
   * debian/modules/headers-more-nginx-module/
     + Updated the Headers-more module with the 0.19 version.
   * debian/modules/README.Modules-versions
     + Updated the current version of modules following the updates.
 .
   [ Michael Lustfield ]
   * debian/conf/sites-available/default
     + Uncommented listen lines to make server block default.
Checksums-Sha1: 
 eb3293aa6d660936ba30a17d6abe3d5adf737b09 2092 nginx_1.2.6-1.dsc
 432059b668e3f018eab61f99c7cc727db88464e8 726025 nginx_1.2.6.orig.tar.gz
 b61483a9a3034e67bf61c75c4c126e59e32d37c5 1486540 nginx_1.2.6-1.debian.tar.gz
 d8951bf8681973e4fed0a5fca5e6a884532d6092 63052 nginx_1.2.6-1_all.deb
 32216e371d97b824655567dfc09f270a9d237a9e 76468 nginx-doc_1.2.6-1_all.deb
 1a4f21dc94af9d1704d37bab2d4012224ab1a5b6 75128 nginx-common_1.2.6-1_all.deb
 b60cba6dc6001a515c3f0d649fd28a50ed3b0533 354440 nginx-naxsi-ui_1.2.6-1_all.deb
 bfdaeb6aebc319dee0fd11d7a2aa268b522d78ee 439376 nginx-full_1.2.6-1_amd64.deb
 dcdc563f8ef0834ac7f5462bf7cae823ee25da18 3104040 
nginx-full-dbg_1.2.6-1_amd64.deb
 b5dce5bd3439fe6c1f6181f03ee30f9d931d47ac 322774 nginx-light_1.2.6-1_amd64.deb
 20ef4c1b84d76bc4ec81a7501cedb397479fb39c 2157836 
nginx-light-dbg_1.2.6-1_amd64.deb
 f11a4da0375e0a2ecc26af2011943e6b17bac3b6 629112 nginx-extras_1.2.6-1_amd64.deb
 bd7bb3b8e8b9f443d3e8d0dc7bd8440862801fb0 4844850 
nginx-extras-dbg_1.2.6-1_amd64.deb
 5c2a152064a404f6cf67458f8091f83bf90b3ade 363330 nginx-naxsi_1.2.6-1_amd64.deb
 a144a2d52b05f375f53c08651a38300cda67d2af 2317156 
nginx-naxsi-dbg_1.2.6-1_amd64.deb
Checksums-Sha256: 
 c78c19b7fe6853f62562486415a72d7ba97b3017ac9b33bee2ae55c294ae791c 2092 
nginx_1.2.6-1.dsc
 0510af71adac4b90484ac8caf3b8bd519a0f7126250c2799554d7a751a2db388 726025 
nginx_1.2.6.orig.tar.gz
 24d4addadaffc45401c2ad81cca1fca05add6e7a96793e80ac6e14f443c345cc 1486540 
nginx_1.2.6-1.debian.tar.gz
 1487a12b40cf20f7f186e120741288a0dc22325a7ec7234dc2ee047a0ff910a7 63052 
nginx_1.2.6-1_all.deb
 9c594f6d8952ffe653d01fe224933bec86b21f40560ebac172d3b00d1bc98ac4 76468 
nginx-doc_1.2.6-1_all.deb
 5213712db022118966b774d7d8c5fad26ba1f73686e17e3b4c09fc2675749a5f 75128 
nginx-common_1.2.6-1_all.deb
 29763f43bdf2a025062a1896719cd8bd0d7fc52dce378a405d1677db7648b14a 354440 
nginx-naxsi-ui_1.2.6-1_all.deb
 365b62d34e4804aeb03a181403d62b8a1b94748e63d1a6c964d66d912eec39d1 439376 
nginx-full_1.2.6-1_amd64.deb
 15930c8366031f536fe3f88bd884071b866f361f9b052c0caf5d1a78066c6b11 3104040 
nginx-full-dbg_1.2.6-1_amd64.deb
 84f77fbcd9dfdb21b6f5eebf1eb5fa8ef7a2319c54683ee0bcf55d304f6ed8e3 322774 
nginx-light_1.2.6-1_amd64.deb
 ebd295fcf684e8a4b377e7f2dee773067408ba210b7991b67b33133366806d3e 2157836 
nginx-light-dbg_1.2.6-1_amd64.deb
 151ae9fb0b864e0d2f6e4d2830ef29dac0078e2277ca28f4beaf94b5379a9897 629112 
nginx-extras_1.2.6-1_amd64.deb
 d5aae22b9ddc5007cf2fd3532dc357ef6b064d9aa7740e3bf4f15058ea3d2008 4844850 
nginx-extras-dbg_1.2.6-1_amd64.deb
 cd216f3c9151148dca74045bcbef464e62c422043111be83bb27e243eea6ddcb 363330 
nginx-naxsi_1.2.6-1_amd64.deb
 ed66673cc8f22958507298d9c363d8b655b72d9d391709df6e351bd3ddcda155 2317156 
nginx-naxsi-dbg_1.2.6-1_amd64.deb
Files: 
 7dde6e71dd1c2f7b7c7e74a9c7079865 2092 httpd optional nginx_1.2.6-1.dsc
 1350d26eb9b66364d9143fb3c4366ab6 726025 httpd optional nginx_1.2.6.orig.tar.gz
 4f191042f57cbb429e2c56255ba76aac 1486540 httpd optional 
nginx_1.2.6-1.debian.tar.gz
 c694a51b1c772f78012ec68b9afdf878 63052 httpd optional nginx_1.2.6-1_all.deb
 75a5bba7f53547e2eb3b8e668e1dd6d1 76468 doc optional nginx-doc_1.2.6-1_all.deb
 6eee8059865e6fae93abad86864da8eb 75128 httpd optional 
nginx-common_1.2.6-1_all.deb
 1bd5d3154627a0d3e0dbfe11da0f4e70 354440 httpd extra 
nginx-naxsi-ui_1.2.6-1_all.deb
 9d051d28a65bc3c0c3737030f4fff2ab 439376 httpd optional 
nginx-full_1.2.6-1_amd64.deb
 8efac7f4c96a48fd4379a0054a7210fc 3104040 debug extra 
nginx-full-dbg_1.2.6-1_amd64.deb
 db14d7d0e4ab66700f54eeed33e497d9 322774 httpd extra 
nginx-light_1.2.6-1_amd64.deb
 35a79e68ca49e2057472a9fba4810be1 2157836 debug extra 
nginx-light-dbg_1.2.6-1_amd64.deb
 17588fc68d4e60c296419164db826d0b 629112 httpd extra 
nginx-extras_1.2.6-1_amd64.deb
 e246ae43b293efb1ec8bde538e424607 4844850 debug extra 
nginx-extras-dbg_1.2.6-1_amd64.deb
 9ced0f279bd4224cfe4ec84da3cc5004 363330 httpd extra 
nginx-naxsi_1.2.6-1_amd64.deb
 cbcb6210b2e04c809a1fd5bf99625f39 2317156 debug extra 
nginx-naxsi-dbg_1.2.6-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEUEARECAAYFAlDP+xAACgkQoRg/jtECjI3dHgCY4UekIxaWvscaJRDhgrGU3Cdh
vACgljJEzyBg1kFo3j/yjlPC1xUU/K0=
=hqCc
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to