lighttpd: print stderr trace if validation fails
authorGlenn Strauss <gstrauss@gluelogic.com>
Sun, 27 Nov 2022 20:39:24 +0000 (15:39 -0500)
committerRosen Penev <rosenp@gmail.com>
Fri, 2 Dec 2022 03:02:21 +0000 (19:02 -0800)
lighttpd.init validate_conf(): print stderr trace if validation fails

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
net/lighttpd/files/lighttpd.init

index 1d290063ef33c6f7dc57222370c2a363b387dac2..04de1784516162f62ed1c32a2e34f1544d30e08e 100644 (file)
@@ -8,8 +8,8 @@ USE_PROCD=1
 PROG=/usr/sbin/lighttpd
 
 validate_conf() {
-       $PROG -tt -f /etc/lighttpd/lighttpd.conf >/dev/null 2>&1 || {
-               echo "validation failed"
+       $PROG -tt -f /etc/lighttpd/lighttpd.conf >/dev/null || {
+               echo 1>&2 "lighttpd.conf validation failed"
                return 1
        }
 }
@@ -34,6 +34,7 @@ service_triggers() {
 }
 
 reload_service() {
+       validate_conf || exit 1
        # lighttpd graceful restart (SIGUSR1)
        procd_send_signal lighttpd '*' USR1
 }