]> git.pld-linux.org Git - packages/ulogd.git/blob - ulogd.init
- up to 1.23
[packages/ulogd.git] / ulogd.init
1 #!/bin/sh
2 #
3 # ulogd         Starts ulogd.
4 #
5 # chkconfig:    2345 91 91
6 # description:  ulogd is the userland packect logger for iptables ULOG target.
7
8 # Source function library
9 . /etc/rc.d/init.d/functions
10
11 # Get network config
12 . /etc/sysconfig/network
13
14 [ -f /usr/sbin/ulogd ] || exit 0
15
16 # Get service config
17 if [ -f /etc/sysconfig/ulogd ]; then
18         . /etc/sysconfig/ulogd
19 fi
20
21 RETVAL=0
22 # See how we were called.
23 CONFIGS=/etc/ulogd.conf
24 if [ "${MULTIPLE}" == "YES" ]; then
25         CONFIGS="$CONFIGS /etc/ulogd/*.conf"
26 fi
27
28 case "$1" in
29   start)
30         # Check if the service is already running?
31         for i in $CONFIGS; do
32                 bname=$(basename $i .conf)
33                 if [ ! -f /var/lock/subsys/ulogd-$bname ]; then
34                         msg_starting ulogd-$bname
35                         daemon ulogd -d -c $i
36                         RETVAL=$?
37                         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ulogd-$bname
38                 else
39                         msg_already_running ulogd-$bname
40                 fi
41                 touch /var/lock/subsys/ulogd
42         done
43         ;;
44   stop)
45         if [ -f /var/lock/subsys/ulogd ]; then
46                 msg_stopping ulogd
47                 killproc ulogd
48                 rm -f /var/lock/subsys/ulogd* >/dev/null 2>&1
49         else
50                 msg_not_running ulogd
51         fi
52         ;;
53   status)
54         status ulogd
55         exit $?
56         ;;
57   restart|force-reload)
58         $0 stop
59         $0 start
60         exit $?
61         ;;
62   *)
63         msg_usage "$0 {start|stop|restart|force-reload|status}"
64         exit 3
65 esac
66
67 exit $RETVAL
This page took 0.025493 seconds and 3 git commands to generate.