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

couchdb.init [new file with mode: 0644]
couchdb.spec

diff --git a/couchdb.init b/couchdb.init
new file mode 100644 (file)
index 0000000..36e3f0a
--- /dev/null
@@ -0,0 +1,124 @@
+#!/bin/sh
+#
+# couchdb      apache couchdb init script
+#
+# chkconfig:   345 85 25
+#
+# description: apache couchdb init script
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Set defaults
+COUCHDB_INI='/etc/apache-couchdb/couch.ini'
+COUCHDB_PID='/var/run/couchdb.pid'
+COUCHDB_USER='couchdb'
+COUCHDB_STDOUT='/dev/null'
+COUCHDB_STDERR='/dev/null'
+COUCHDB_RESPAWN='5'
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/couchdb ] && . /etc/sysconfig/couchdb
+
+# 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
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+start() {
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/couchdb ]; then
+               msg_starting couchdb
+                test -n $COUCHDB_PID \
+                    && touch $COUCHDB_PID \
+                    && chown $COUCHDB_USER $COUCHDB_PID
+               daemon --user $COUCHDB_USER /usr/bin/couchdb \
+                    -b -c "$COUCHDB_INI" -p "$COUCHDB_PID" \
+                    -o "$COUCHDB_STDOUT" -e "$COUCHDB_STDERR" \
+                    -r "$COUCHDB_RESPAWN"
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/couchdb
+       else
+               msg_already_running couchdb
+       fi
+}
+
+stop() {
+       if [ -f /var/lock/subsys/couchdb ]; then
+               # Stop daemons.
+               msg_stopping couchdb
+               killproc couchdb
+               killproc --pidfile $COUCHDB_PID couchdb -TERM
+               rm -f /var/lock/subsys/couchdb
+       else
+               msg_not_running couchdb
+       fi
+}
+
+reload() {
+       if [ -f /var/lock/subsys/couchdb ]; then
+               msg_reloading couchdb
+               killproc couchdb -HUP
+               killproc --pidfile $COUCHDB_PID couchdb -HUP
+               RETVAL=$?
+       else
+               msg_not_running couchdb
+               RETVAL=7
+       fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/couchdb ]; then
+               stop
+               start
+       else
+               msg_not_running couchdb
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  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=$?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
index c0a0c8521d8dc5b60b154eb263288555973d2d1c..7cdb3b98bb84143fcd1a28887bdab690c6314b79 100644 (file)
@@ -10,10 +10,10 @@ Version:    1.0.1
 Release:       0.1
 License:       Apache
 Group:         Applications
-Source0:       http://www.apache.net.pl/couchdb/1.0.1/apache-%{name}-%{version}.tar.gz
+Source0:       http://www.apache.org/dist/couchdb/%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: 001cf286b72492617e9ffba271702a00
-#Source1:      %{name}.init
-URL:           http://incubator.apache.org/couchdb/
+Source1:       %{name}.init
+URL:           http://couchdb.apache.org/
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: curl-devel >= 7.18.0
This page took 0.098216 seconds and 4 git commands to generate.