Initial commit: Uploaded everything from abs/core
[arch-rock.git] / base / syslog-ng / syslog-ng
blobf9d14c7f6d19628a529d314b95650c84ffa76b03
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/sbin/syslog-ng`
7 case "$1" in
8 start)
9 stat_busy "Starting Syslog-NG"
10 [ -z "$PID" ] && /usr/sbin/syslog-ng
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 add_daemon syslog-ng
15 stat_done
18 stop)
19 stat_busy "Stopping Syslog-NG"
20 [ ! -z "$PID" ] && kill $PID &> /dev/null
21 if [ $? -gt 0 ]; then
22 stat_fail
23 else
24 rm -f /var/run/syslog-ng.pid
25 # Removing stale syslog-ng.persist file. It's new location, as of 2.0.6-1, is /var/lib/syslog-ng/
26 rm -f /var/syslog-ng.persist
27 rm_daemon syslog-ng
28 stat_done
31 restart)
32 $0 stop
33 sleep 1
34 $0 start
37 echo "usage: $0 {start|stop|restart}"
38 esac
39 exit 0