SOURCES: specter.init (NEW), specter.logrotate (NEW), specter.sysc...

undefine undefine at pld-linux.org
Tue Feb 12 02:06:54 CET 2008


Author: undefine                     Date: Tue Feb 12 01:06:54 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- initial

---- Files affected:
SOURCES:
   specter.init (NONE -> 1.1)  (NEW), specter.logrotate (NONE -> 1.1)  (NEW), specter.sysconfig (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/specter.init
diff -u /dev/null SOURCES/specter.init:1.1
--- /dev/null	Tue Feb 12 02:06:54 2008
+++ SOURCES/specter.init	Tue Feb 12 02:06:49 2008
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# specter		Starts specter.
+#
+# chkconfig:	2345 91 91
+# description:	specter is the userland packect logger for iptables ULOG target.
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+[ -f /usr/sbin/specter ] || exit 0
+
+# Get service config
+if [ -f /etc/sysconfig/specter ]; then
+	. /etc/sysconfig/specter
+fi
+
+RETVAL=0
+# See how we were called.
+CONFIGS=/etc/specter.conf
+if [ "${MULTIPLE}" == "YES" ]; then
+	CONFIGS="$CONFIGS /etc/specter/*.conf"
+fi
+
+case "$1" in
+  start)
+	# Check if the service is already running?
+	for i in $CONFIGS; do
+		bname=$(basename $i .conf)
+		if [ ! -f /var/lock/subsys/specter-$bname ]; then
+			msg_starting specter-$bname
+			daemon specter -d -c $i
+			RETVAL=$?
+			[ $RETVAL -eq 0 ] && touch /var/lock/subsys/specter-$bname
+		else
+			msg_already_running specter-$bname
+		fi
+		touch /var/lock/subsys/specter
+	done
+	;;
+  stop)
+	if [ -f /var/lock/subsys/specter ]; then
+		msg_stopping specter
+		killproc specter
+		rm -f /var/lock/subsys/specter* >/dev/null 2>&1
+	else
+		msg_not_running specter
+	fi
+	;;
+  status)
+	status specter
+	exit $?
+	;;
+  restart|force-reload)
+	$0 stop
+	$0 start
+	exit $?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL

================================================================
Index: SOURCES/specter.logrotate
diff -u /dev/null SOURCES/specter.logrotate:1.1
--- /dev/null	Tue Feb 12 02:06:54 2008
+++ SOURCES/specter.logrotate	Tue Feb 12 02:06:49 2008
@@ -0,0 +1,5 @@
+/var/log/specter* {
+        postrotate
+		/etc/rc.d/init.d/specter reload >/dev/null 2>&1
+        endscript
+}

================================================================
Index: SOURCES/specter.sysconfig
diff -u /dev/null SOURCES/specter.sysconfig:1.1
--- /dev/null	Tue Feb 12 02:06:54 2008
+++ SOURCES/specter.sysconfig	Tue Feb 12 02:06:49 2008
@@ -0,0 +1,5 @@
+# Nice level for ulogd
+SERVICE_RUN_NICE_LEVEL="-1"
+
+# use "YES" when you want multiple specter instantions in /etc/ulog/*.conf
+MULTIPLE="NO"
================================================================


More information about the pld-cvs-commit mailing list