diff --git a/admin/syslog-ng/Makefile b/admin/syslog-ng/Makefile index 0a2c99bf0..e294ff577 100644 --- a/admin/syslog-ng/Makefile +++ b/admin/syslog-ng/Makefile @@ -2,13 +2,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=syslog-ng PKG_VERSION:=3.9.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_MAINTAINER:=W. Michael Petullo PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/balabit/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ -PKG_MD5SUM:=1b48da9ef620cf06e55e481b5abb677a PKG_HASH:=5678856a550ae790618fabde9d1447f932ce7a9080d55dca8fc5df1202c70a17 PKG_INSTALL:=1 @@ -31,7 +30,8 @@ define Package/syslog-ng/description endef define Package/syslog-ng/conffiles - /etc/syslog-ng.conf +/etc/syslog-ng.conf +/etc/syslog-ng.d/ endef define Build/Configure @@ -69,8 +69,8 @@ define Package/syslog-ng/install install-moduleLTLIBRARIES DESTDIR="$(1)" $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng - $(INSTALL_DIR) $(1)/etc $(INSTALL_DATA) ./files/syslog-ng.conf $(1)/etc + $(INSTALL_DIR) $(1)/etc/syslog-ng.d/ $(call libtool_remove_files,$(1)) endef diff --git a/admin/syslog-ng/files/custom-logs.conf b/admin/syslog-ng/files/custom-logs.conf deleted file mode 100644 index 9c8f4413b..000000000 --- a/admin/syslog-ng/files/custom-logs.conf +++ /dev/null @@ -1,2 +0,0 @@ -# place to put customization of logging - diff --git a/admin/syslog-ng/files/syslog-ng.conf b/admin/syslog-ng/files/syslog-ng.conf index 9e09a79e2..cae24a848 100644 --- a/admin/syslog-ng/files/syslog-ng.conf +++ b/admin/syslog-ng/files/syslog-ng.conf @@ -36,5 +36,6 @@ log { destination(messages); }; -@include "/etc/custom-logs.conf" +# put any customization files in this directory +@include "/etc/syslog-ng.d/" diff --git a/admin/syslog-ng/files/syslog-ng.init b/admin/syslog-ng/files/syslog-ng.init index cecb3f904..5af9bb47b 100644 --- a/admin/syslog-ng/files/syslog-ng.init +++ b/admin/syslog-ng/files/syslog-ng.init @@ -2,18 +2,30 @@ # Copyright (C) 2006-2016 OpenWrt.org START=20 +PROG=/usr/sbin/syslog-ng +PROG2=/usr/sbin/syslog-ng-ctl SERVICE_USE_PID=1 +SERVICE_PID_FILE=/var/log/syslog-ng.pid + +config_file=/etc/syslog-ng.conf start() { - [ -f /etc/syslog-ng.conf ] || return 1 - service_start /usr/sbin/syslog-ng + [ -f $config_file ] || return 1 + + 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() { - service_stop /usr/sbin/syslog-ng + service_stop $PROG } reload() { - service_reload /usr/sbin/syslog-ng + $PROG2 reload }