SOURCES: sphinx.init (NEW) - based on template

glen glen at pld-linux.org
Tue May 15 14:06:30 CEST 2007


Author: glen                         Date: Tue May 15 12:06:30 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- based on template

---- Files affected:
SOURCES:
   sphinx.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/sphinx.init
diff -u /dev/null SOURCES/sphinx.init:1.1
--- /dev/null	Tue May 15 14:06:30 2007
+++ SOURCES/sphinx.init	Tue May 15 14:06:25 2007
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# sphinx	sphinx short service description
+#
+# chkconfig:	345 <start_level> <stop_level>
+#
+# description:	sphinx long service description
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/sphinx ] && . /etc/sysconfig/sphinx
+
+# 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 sphinx
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/sphinx ]; then
+		msg_starting sphinx
+		daemon sphinx
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sphinx
+	else
+		msg_already_running sphinx
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/sphinx ]; then
+		# Stop daemons.
+		msg_stopping sphinx
+		killproc sphinx
+		rm -f /var/lock/subsys/sphinx
+	else
+		msg_not_running sphinx
+	fi
+}
+
+reload() {
+	if [ -f /var/lock/subsys/sphinx ]; then
+		msg_reloading sphinx
+		killproc sphinx -HUP
+		RETVAL=$?
+	else
+		msg_not_running sphinx
+		RETVAL=7
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  status)
+	status sphinx
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list