updated on Sat Jan 21 04:00:54 UTC 2012
[aur-mirror.git] / ulogd / rc
blob071546f8cec9566ca6cdb18f7756d5fe4fc862ea
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 get_pid() {
7 pidof /usr/sbin/ulogd
10 case "$1" in
11 start)
12 stat_busy "Starting ulogd daemon"
14 [ -f /var/run/ulog.pid ] && rm -f /var/run/ulog.pid
15 PID=`get_pid`
16 if [ -z "$PID" ]; then
17 /usr/sbin/ulogd -d
18 if [ $? -gt 0 ]; then
19 stat_fail
20 exit 1
21 else
22 echo `get_pid` > /var/run/ulogd.pid
23 add_daemon ulogd
24 stat_done
26 else
27 stat_fail
28 exit 1
32 stop)
33 stat_busy "Stopping ulog daemon"
34 PID=`get_pid`
35 [ ! -z "$PID" ] && kill $PID &> /dev/null
36 if [ $? -gt 0 ]; then
37 stat_fail
38 exit 1
39 else
40 rm -f /var/run/ulogd.pid &> /dev/null
41 rm_daemon ulogd
42 stat_done
46 restart)
47 $0 stop
48 sleep 3
49 $0 start
52 echo "usage: $0 {start|stop|restart}"
53 esac
54 exit 0