port over more init scripts
[openwrt/svn-archive/archive.git] / admin / syslog-ng / files / syslog-ng.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 start() {
5 [ -f /etc/syslog-ng/syslog-ng.conf ] || {
6 echo "/etc/syslog-ng/syslog-ng.conf does not exist !";
7 exit 0;
8 };
9 [ -d /var/run ] || mkdir -p /var/run
10 [ -x /usr/sbin/syslog-ng ] && /usr/sbin/syslog-ng
11 }
12
13 stop() {
14 killall syslog-ng
15 }
16
17 restart() {
18 stop
19 sleep 1
20 start
21 }
22
23 reload() {
24 kill -HUP `cat /var/run/syslog-ng.pid` &>/dev/null
25 }
26