syslog-ng: Use procd style init

Signed-off-by: Michal Hrusecky <michal.hrusecky@nic.cz>
This commit is contained in:
Michal Hrusecky 2017-09-04 09:50:40 +02:00 committed by Josef Schlehofer
parent e549c53f36
commit 41f3511093
No known key found for this signature in database
GPG Key ID: B950216FE4329F4C
1 changed files with 10 additions and 23 deletions

View File

@ -1,31 +1,18 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
# Copyright (C) 2006-2016 OpenWrt.org # Copyright (C) 2006-2016 OpenWrt.org
START=20 START=50
PROG=/usr/sbin/syslog-ng
PROG2=/usr/sbin/syslog-ng-ctl
SERVICE_USE_PID=1 USE_PROCD=1
SERVICE_PID_FILE=/var/run/syslog-ng.pid
config_file=/etc/syslog-ng.conf start_service() {
[ -f /etc/syslog-ng.conf ] || return 1
start() { procd_open_instance
[ -f $config_file ] || return 1 procd_set_param command /usr/sbin/syslog-ng
procd_close_instance
if ! $PROG -s 2>/dev/null ; then
echo "Couldn't parse $(basename $config_file)" >&2
exit 1
fi
service_start $PROG --process-mode background \
-p $SERVICE_PID_FILE
} }
stop() { reload_service() {
service_stop $PROG stop
} start
reload() {
$PROG2 reload
} }