SOURCES: openhpi-subagent.init (NEW), openhpi-subagent.sysconfig (...

qboosh qboosh at pld-linux.org
Sat Oct 22 22:35:20 CEST 2005


Author: qboosh                       Date: Sat Oct 22 20:35:20 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- PLD-style init script (untested)

---- Files affected:
SOURCES:
   openhpi-subagent.init (NONE -> 1.1)  (NEW), openhpi-subagent.sysconfig (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/openhpi-subagent.init
diff -u /dev/null SOURCES/openhpi-subagent.init:1.1
--- /dev/null	Sat Oct 22 22:35:20 2005
+++ SOURCES/openhpi-subagent.init	Sat Oct 22 22:35:15 2005
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# openhpi-subagent	HPI SNMP Subagent
+#
+# chkconfig:	345 55 45
+#
+# description:	HPI SNMP Subagent
+#
+# $Id$
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+OPTIONS=-f
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/openhpi-subagent ] && . /etc/sysconfig/openhpi-subagent
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network ]; then
+		# nls "ERROR: Networking is down. %s can't be run." openhpi-subagent
+		msg_network_down openhpi-subagent
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+
+# See how we were called.
+case "$1" in
+  start)
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/openhpi-subagent ]; then
+		# show "Starting %s service" openhpi-subagent
+		msg_starting openhpi-subagent
+		daemon hpiSubagent $OPTIONS
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/openhpi-subagent
+	else
+		# show "%s service is already running." openhpi-subagent
+		msg_already_running openhpi-subagent
+	fi
+	;;
+  stop)
+	if [ -f /var/lock/subsys/openhpi-subagent ]; then
+		# Stop daemons.
+		# show "Stopping %s service" openhpi-subagent
+		msg_stopping openhpi-subagent
+		killproc hpiSubagent
+		rm -f /var/lock/subsys/openhpi-subagent
+	else
+		# show "%s service is not running." openhpi-subagent
+		msg_not_running openhpi-subagent
+	fi
+	;;
+  restart)
+	$0 stop
+	$0 start
+	exit $?
+	;;
+  reload)
+	if [ -f /var/lock/subsys/openhpi-subagent ]; then
+		# show "Reload %s service" openhpi-subagent
+		msg_reloading openhpi-subagent
+		killproc hpiSubagent -HUP
+		RETVAL=$?
+	else
+		# show "%s service is not running." <service>
+		msg_not_running openhpi-subagent >&2
+		RETVAL=7
+	fi
+	;;
+  force-reload)
+	# if program allows reloading without stopping
+	$0 reload
+
+	# or if it doesn't
+	$0 restart
+
+	exit $?
+	;;
+  status)
+	status hpiSubagent
+	RETVAL=$?
+	;;
+  *)
+	# show "Usage: %s {start|stop|restart|reload|force-reload|status}"
+	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh:tw=78:ts=8:sw=4

================================================================
Index: SOURCES/openhpi-subagent.sysconfig
diff -u /dev/null SOURCES/openhpi-subagent.sysconfig:1.1
--- /dev/null	Sat Oct 22 22:35:20 2005
+++ SOURCES/openhpi-subagent.sysconfig	Sat Oct 22 22:35:15 2005
@@ -0,0 +1,7 @@
+# Customized settings for openhpi-subagent
+
+# Define nice level for openhpi-subagent
+SERVICE_RUN_NICE_LEVEL="+0"
+
+# Daemon options
+#OPTIONS="-f"
================================================================



More information about the pld-cvs-commit mailing list