Author: glen                         Date: Tue Oct 14 19:40:03 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- initial

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

---- Diffs:

================================================================
Index: SOURCES/switchboard.init
diff -u /dev/null SOURCES/switchboard.init:1.1
--- /dev/null   Tue Oct 14 21:40:04 2008
+++ SOURCES/switchboard.init    Tue Oct 14 21:39:58 2008
@@ -0,0 +1,106 @@
+#!/bin/sh
+#
+# switchboard  switchboard is a FastCGI proxy
+#
+# chkconfig:   345 80 30
+#
+# description: switchboard is a FastCGI proxy
+#
+# processname: switchboard
+# config:
+# pidfile:
+#
+# $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/switchboard ] && . /etc/sysconfig/switchboard
+
+# 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 switchboard
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+start() {
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/switchboard ]; then
+               msg_starting switchboard
+               daemon /usr/sbin/switchboard
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/switchboard
+       else
+               msg_already_running switchboard
+       fi
+}
+
+stop() {
+       if [ -f /var/lock/subsys/switchboard ]; then
+               # Stop daemons.
+               msg_stopping switchboard
+               killproc --pidfile /var/run/switchboard.pid switchboard -TERM
+               rm -f /var/lock/subsys/switchboard
+       else
+               msg_not_running switchboard
+       fi
+}
+
+reload() {
+       if [ -f /var/lock/subsys/switchboard ]; then
+               msg_reloading switchboard
+               killproc --pidfile /var/run/switchboard.pid switchboard -HUP
+               RETVAL=$?
+       else
+               msg_not_running switchboard
+               RETVAL=7
+       fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/switchboard ]; then
+               stop
+               start
+       else
+               msg_not_running switchboard
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  reload|force-reload)
+       reload
+       ;;
+  status)
+       status switchboard
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 
{start|stop|restart|try-restart|reload|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to