SOURCES: cherokee.init - log output and workaround for broken -b

glen glen at pld-linux.org
Sat Dec 31 16:55:26 CET 2005


Author: glen                         Date: Sat Dec 31 15:55:26 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- log output and workaround for broken -b

---- Files affected:
SOURCES:
   cherokee.init (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/cherokee.init
diff -u SOURCES/cherokee.init:1.2 SOURCES/cherokee.init:1.3
--- SOURCES/cherokee.init:1.2	Sat Dec 31 16:32:42 2005
+++ SOURCES/cherokee.init	Sat Dec 31 16:55:21 2005
@@ -33,9 +33,17 @@
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/cherokee ]; then
 		msg_starting "Cherokee Web Server"
-		start-stop-daemon --start --exec /usr/sbin/cherokee --background --pidfile /var/run/cherokee.pid
+		(
+		# it offers no stdout/stderr logging. workaround
+		exec 2>>/var/log/cherokee/cherokee.log
+		exec 1>&2
+		start-stop-daemon --start --exec /usr/sbin/cherokee --pidfile /var/run/cherokee.pid -- -b
+		)
 		RETVAL=$?
 		if [ $RETVAL -eq 0 ]; then
+			# the pidfile written is wrong when cherokee -b is used. damn
+			pid=$(/sbin/pidof cherokee)
+			echo $pid > /var/run/cherokee.pid
 			touch /var/lock/subsys/cherokee
 			ok
 		else
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/cherokee.init?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list