-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathulogd
More file actions
62 lines (51 loc) · 1.43 KB
/
ulogd
File metadata and controls
62 lines (51 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
### BEGIN INIT INFO
# Provides: ulogd
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts ulogd daemon
# Description: ulogd provides userspace log targets for iptables
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/ulogd
CONFIG=/etc/ulogd.conf
NAME=ulogd
DESC="ULOG logging daemon"
PIDFILE=/var/run/$NAME.pid
OPTS="-c $CONFIG"
case "$1" in
start)
echo -n "Starting $DESC: "
if [ "`pidof $NAME`" = "" ]
then
start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --quiet --exec $DAEMON -- $OPTS
echo "$NAME."
else
echo ""
echo "A copy of the daemon is still running. If you just stopped it,"
echo "please wait about 5 seconds for it to shut down."
exit 0
fi
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --oknodo --pidfile $PIDFILE || echo "Not Running."
rm -f $PIDFILE
echo "$NAME."
;;
restart|force-reload)
$0 stop
sleep 10
$0 start
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" &>2
exit 1
;;
esac
exit 0