X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;ds=sidebyside;f=couchdb.init;h=5789f23f98dbd85b49c7132287d6d6875b6eb833;hb=ddc0004f70f4ad3170c4c97e40614f75d2bb4de4;hp=0ecafdf397f6ece474f96afae90fd6d351b4db15;hpb=18384d739f0581ef9e3a213880b7ffd4fd3fa762;p=packages%2Fcouchdb.git diff --git a/couchdb.init b/couchdb.init index 0ecafdf..5789f23 100644 --- a/couchdb.init +++ b/couchdb.init @@ -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=$? ;;