]> git.pld-linux.org Git - packages/couchdb.git/blobdiff - couchdb.init
- respawn timeout to 0
[packages/couchdb.git] / couchdb.init
index 0ecafdf397f6ece474f96afae90fd6d351b4db15..5789f23f98dbd85b49c7132287d6d6875b6eb833 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
-# couchdb      Starts CouchDB
+# couchdb      Apache CouchDB init script
 # chkconfig:   2345 84 25
-# description: Apache CouchDB init script
+# description: Apache CouchDB init script for the database server.
 # pidfile:     /var/run/couchdb.pid
 #
 # $Id$
@@ -20,7 +20,7 @@ COUCHDB_PID='/var/run/couchdb.pid'
 COUCHDB_USER='couchdb'
 COUCHDB_STDOUT='/dev/null'
 COUCHDB_STDERR='/dev/null'
-COUCHDB_RESPAWN='5'
+COUCHDB_RESPAWN_TIMEOUT='0'
 
 # Get service config - may override defaults
 [ -f /etc/sysconfig/couchdb ] && . /etc/sysconfig/couchdb
@@ -47,9 +47,10 @@ start() {
                && 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"
+               -b -c "$COUCHDB_INI" -p "$COUCHDB_PID" \
+               -o "$COUCHDB_STDOUT" -e "$COUCHDB_STDERR" \
+               -r "$COUCHDB_RESPAWN_TIMEOUT" \
+               $COUCHDB_OPTIONS
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/couchdb
 }
@@ -62,7 +63,14 @@ stop() {
 
        # Stop daemons.
        msg_stopping "CouchDB"
-       killproc --pidfile $COUCHDB_PID couchdb -TERM
+       su $COUCHDB_USER -c "$COUCHDB -d $COUCHDB_OPTIONS"
+       RETVAL=$?
+       if [ $RETVAL -eq 0 ]; then
+               ok
+       else
+               fail
+       fi
+
        rm -f $COUCHDB_PID
        rm -f /var/lock/subsys/couchdb
 }
@@ -110,6 +118,8 @@ case "$1" in
        reload
        ;;
   status)
+    # Display the status of the running Apache CouchDB process.
+    $COUCHDB -s
        status couchdb
        RETVAL=$?
        ;;
This page took 0.107199 seconds and 4 git commands to generate.