summaryrefslogtreecommitdiff
path: root/community/ulogd/rc
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-08-23 23:14:30 +0000
committerroot <root@rshg054.dnsready.net>2011-08-23 23:14:30 +0000
commit9254c2bc6500471b22eead69781ddef84f87e2bf (patch)
treec4afa4b28422f98d69f9b2594705e164e8c3049c /community/ulogd/rc
parent64e290184042563a240e2d6d15c02e06703d00ee (diff)
Tue Aug 23 23:14:30 UTC 2011
Diffstat (limited to 'community/ulogd/rc')
-rw-r--r--community/ulogd/rc54
1 files changed, 54 insertions, 0 deletions
diff --git a/community/ulogd/rc b/community/ulogd/rc
new file mode 100644
index 000000000..756abdf86
--- /dev/null
+++ b/community/ulogd/rc
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+get_pid() {
+ pidof /usr/sbin/ulogd
+}
+
+case "$1" in
+ start)
+ stat_busy "Starting ulogd daemon"
+
+ [ -f /var/run/ulog.pid ] && rm -f /var/run/ulog.pid
+ PID=`get_pid`
+ if [ -z "$PID" ]; then
+ /usr/sbin/ulogd -d
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ echo `get_pid` > /var/run/ulogd.pid
+ add_daemon ulogd
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping ulog daemon"
+ PID=`get_pid`
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ rm -f /var/run/ulogd.pid &> /dev/null
+ rm_daemon ulogd
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0