From 08a13fb27a01219f435241e7b065edf14916f333 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Tue, 25 Jul 2017 14:16:37 -0600 Subject: [PATCH] syslog-ng: add syntax check to startup script Signed-off-by: Philip Prindeville --- admin/syslog-ng/files/syslog-ng.init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/admin/syslog-ng/files/syslog-ng.init b/admin/syslog-ng/files/syslog-ng.init index 545ca0091..540a40a4c 100644 --- a/admin/syslog-ng/files/syslog-ng.init +++ b/admin/syslog-ng/files/syslog-ng.init @@ -12,6 +12,12 @@ config_file=/etc/syslog-ng.conf start() { [ -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 }