SOURCES: naviagent.init (NEW) - new
glen
glen at pld-linux.org
Thu Nov 15 16:36:51 CET 2007
Author: glen Date: Thu Nov 15 15:36:51 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- new
---- Files affected:
SOURCES:
naviagent.init (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/naviagent.init
diff -u /dev/null SOURCES/naviagent.init:1.1
--- /dev/null Thu Nov 15 16:36:51 2007
+++ SOURCES/naviagent.init Thu Nov 15 16:36:46 2007
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# chkconfig: 345 25 35
+# config: /etc/Navisphere/agent.config
+# processname: agent
+# description: naviagent provides an easy way of starting and stopping the
+# navisphere agent at bootup time.
+#
+# $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/naviagent ] && . /etc/sysconfig/naviagent
+
+# 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 naviagent
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+start() {
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/naviagent ]; then
+ msg_starting "Navisphere Agent"
+ daemon naviagent
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/naviagent
+ else
+ msg_already_running "Navisphere Agent"
+ fi
+}
+
+stop() {
+ if [ -f /var/lock/subsys/naviagent ]; then
+ # Stop daemons.
+ msg_stopping "Navisphere Agent"
+ killproc naviagent
+ rm -f /var/lock/subsys/naviagent
+ else
+ msg_not_running "Navisphere Agent"
+ fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ status)
+ status naviagent
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|status}"
+ exit 3
+esac
+
+exit $RETVAL
================================================================
More information about the pld-cvs-commit
mailing list