From 44a16ca3253c1395671905a83d60fa8e604a273a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 10 Jun 2019 09:40:44 +0200 Subject: [PATCH] syslog-ng: improve init and fix service stop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes service stop. Problem was that in default syslog-ng forks to background which causes procd to loose track of it. It no longer has in such case PID of syslog-ng process and is unable to stop it. This means that instance for such process hangs in procd and also it is not possible to stop it as daemon. Fix is simple. syslog-ng is now instructed to run in foreground. This commit also drops unnecessary reload section. In default reload calls restart and restart in default is implemented as calling stop and start. This means that effectively it is implemented same as in case of this init reload service implementation. Signed-off-by: Karel Kočí --- admin/syslog-ng/Makefile | 2 +- admin/syslog-ng/files/syslog-ng.init | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/admin/syslog-ng/Makefile b/admin/syslog-ng/Makefile index d1a1664e5..699bd3e32 100644 --- a/admin/syslog-ng/Makefile +++ b/admin/syslog-ng/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=syslog-ng PKG_VERSION:=3.21.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_MAINTAINER:=Josef Schlehofer PKG_LICENSE:=LGPL-2.1+ diff --git a/admin/syslog-ng/files/syslog-ng.init b/admin/syslog-ng/files/syslog-ng.init index 7b9488b28..b68c6574f 100644 --- a/admin/syslog-ng/files/syslog-ng.init +++ b/admin/syslog-ng/files/syslog-ng.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006-2016 OpenWrt.org +# Copyright (C) 2006-2019 OpenWrt.org START=50 @@ -8,11 +8,6 @@ USE_PROCD=1 start_service() { [ -f /etc/syslog-ng.conf ] || return 1 procd_open_instance - procd_set_param command /usr/sbin/syslog-ng + procd_set_param command /usr/sbin/syslog-ng --foreground procd_close_instance } - -reload_service() { - stop - start -}