]> git.pld-linux.org Git - packages/couchdb.git/commitdiff
- initscript fixups
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 26 Feb 2012 11:33:13 +0000 (11:33 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    couchdb.init -> 1.5

couchdb.init

index 4665e6eefbd9c5ceb07adc13c865bb8d21cf2922..10d6a46dda5e7f99bbb057c77e662586d15e3530 100644 (file)
@@ -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 @@ COUCHDB_RESPAWN='5'
 # 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 @@ fi
 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 @@ start() {
 
 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,15 +105,9 @@ case "$1" in
   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
        RETVAL=$?
This page took 0.052882 seconds and 4 git commands to generate.