2017-01-06 13:51:50 +01:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2006-2016 OpenWrt.org
|
|
|
|
|
2017-01-08 00:47:17 +01:00
|
|
|
START=20
|
2017-07-25 22:13:53 +02:00
|
|
|
PROG=/usr/sbin/syslog-ng
|
|
|
|
PROG2=/usr/sbin/syslog-ng-ctl
|
2017-01-06 13:51:50 +01:00
|
|
|
|
|
|
|
SERVICE_USE_PID=1
|
2017-07-28 05:03:11 +02:00
|
|
|
SERVICE_PID_FILE=/var/run/syslog-ng.pid
|
2017-07-25 22:13:53 +02:00
|
|
|
|
|
|
|
config_file=/etc/syslog-ng.conf
|
2017-01-06 13:51:50 +01:00
|
|
|
|
|
|
|
start() {
|
2017-07-25 22:13:53 +02:00
|
|
|
[ -f $config_file ] || return 1
|
2017-07-25 22:16:37 +02:00
|
|
|
|
|
|
|
if ! $PROG -s 2>/dev/null ; then
|
|
|
|
echo "Couldn't parse $(basename $config_file)" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-07-25 22:15:05 +02:00
|
|
|
service_start $PROG --process-mode background \
|
|
|
|
-p $SERVICE_PID_FILE
|
2017-01-06 13:51:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2017-07-25 22:13:53 +02:00
|
|
|
service_stop $PROG
|
2017-01-06 13:51:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
2017-07-25 22:17:41 +02:00
|
|
|
$PROG2 reload
|
2017-01-06 13:51:50 +01:00
|
|
|
}
|