From 769ba4645df3c2f793bc2d3ee245573b79b206d3 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 10 Oct 2012 00:43:13 -0700 Subject: Wed Oct 10 00:43:09 PDT 2012 --- community/ulogd/ulogd.rc | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 community/ulogd/ulogd.rc (limited to 'community/ulogd/ulogd.rc') diff --git a/community/ulogd/ulogd.rc b/community/ulogd/ulogd.rc new file mode 100644 index 000000000..83f0550cc --- /dev/null +++ b/community/ulogd/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 &>/dev/null + 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 -- cgit v1.2.3-54-g00ecf