packages: couchdb/couchdb.spec, couchdb/couchdb.init - restore initscript

glen glen at pld-linux.org
Sun Feb 26 12:02:32 CET 2012


Author: glen                         Date: Sun Feb 26 11:02:32 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- restore initscript

---- Files affected:
packages/couchdb:
   couchdb.spec (1.4 -> 1.5) , couchdb.init (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/couchdb/couchdb.spec
diff -u packages/couchdb/couchdb.spec:1.4 packages/couchdb/couchdb.spec:1.5
--- packages/couchdb/couchdb.spec:1.4	Sun Feb 26 11:59:17 2012
+++ packages/couchdb/couchdb.spec	Sun Feb 26 12:02:26 2012
@@ -11,10 +11,10 @@
 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
@@ -111,6 +111,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.5  2012/02/26 11:02:26  glen
+- restore initscript
+
 Revision 1.4  2012/02/26 10:59:17  glen
 - merge todo
 

================================================================
Index: packages/couchdb/couchdb.init
diff -u /dev/null packages/couchdb/couchdb.init:1.3
--- /dev/null	Sun Feb 26 12:02:32 2012
+++ packages/couchdb/couchdb.init	Sun Feb 26 12:02:26 2012
@@ -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
================================================================

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



More information about the pld-cvs-commit mailing list