packages: couchdb/couchdb.init - initscript fixups

glen glen at pld-linux.org
Sun Feb 26 12:33:18 CET 2012


Author: glen                         Date: Sun Feb 26 11:33:18 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- initscript fixups

---- Files affected:
packages/couchdb:
   couchdb.init (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: packages/couchdb/couchdb.init
diff -u packages/couchdb/couchdb.init:1.4 packages/couchdb/couchdb.init:1.5
--- packages/couchdb/couchdb.init:1.4	Sun Feb 26 12:28:47 2012
+++ packages/couchdb/couchdb.init	Sun Feb 26 12:33:13 2012
@@ -1,10 +1,9 @@
 #!/bin/sh
 #
-# couchdb	apache couchdb init script
-#
-# chkconfig:	345 85 25
-#
-# description:	apache couchdb init script
+# couchdb	Starts CouchDB
+# chkconfig:	2345 84 25
+# description:	Apache CouchDB init script
+# pidfile:	/var/run/couchdb.pid
 #
 # $Id$
 
@@ -15,6 +14,7 @@
 . /etc/sysconfig/network
 
 # Set defaults
+COUCHDB="/usr/bin/couchdb"
 COUCHDB_INI='/etc/apache-couchdb/couch.ini'
 COUCHDB_PID='/var/run/couchdb.pid'
 COUCHDB_USER='couchdb'
@@ -28,7 +28,7 @@
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
 	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
-		msg_network_down couchdb
+		msg_network_down "CouchDB"
 		exit 1
 	fi
 else
@@ -38,15 +38,15 @@
 start() {
 	# Check if the service is already running?
 	if [ -f /var/lock/subsys/couchdb ]; then
-		msg_already_running couchdb
+		msg_already_running "CouchDB"
 		return
 	fi
 
-	msg_starting couchdb
-			test -n $COUCHDB_PID \
-				&& touch $COUCHDB_PID \
-				&& chown $COUCHDB_USER $COUCHDB_PID
-	daemon --user $COUCHDB_USER /usr/bin/couchdb \
+	msg_starting "CouchDB"
+	test -n $COUCHDB_PID \
+		&& touch $COUCHDB_PID \
+		&& chown $COUCHDB_USER $COUCHDB_PID
+	daemon --user $COUCHDB_USER $COUCHDB \
 				-b -c "$COUCHDB_INI" -p "$COUCHDB_PID" \
 				-o "$COUCHDB_STDOUT" -e "$COUCHDB_STDERR" \
 				-r "$COUCHDB_RESPAWN"
@@ -56,33 +56,31 @@
 
 stop() {
 	if [ ! -f /var/lock/subsys/couchdb ]; then
-		msg_not_running couchdb
+		msg_not_running "CouchDB"
 		return
 	fi
 
 	# Stop daemons.
-	msg_stopping couchdb
-	killproc couchdb
+	msg_stopping "CouchDB"
 	killproc --pidfile $COUCHDB_PID couchdb -TERM
 	rm -f /var/lock/subsys/couchdb
 }
 
 reload() {
 	if [ ! -f /var/lock/subsys/couchdb ]; then
-		msg_not_running couchdb
+		msg_not_running "CouchDB"
 		RETVAL=7
 		return
 	fi
 
-	msg_reloading couchdb
-	killproc couchdb -HUP
+	msg_reloading "CouchDB"
 	killproc --pidfile $COUCHDB_PID couchdb -HUP
 	RETVAL=$?
 }
 
 condrestart() {
 	if [ ! -f /var/lock/subsys/couchdb ]; then
-		msg_not_running couchdb
+		msg_not_running "CouchDB"
 		RETVAL=$1
 		return
 	fi
@@ -107,14 +105,8 @@
   try-restart)
 	condrestart 0
 	;;
-# include force-reload here if program allows reloading without restart
-# otherwise remove reload action and support force-reload as restart if running
   reload|force-reload)
   	reload
-	;;
-# use this one if program doesn't support reloading without restart
-  force-reload)
-	condrestart 7
 	;;
   status)
 	status couchdb
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/couchdb/couchdb.init?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list