Glenn Strauss
unread,Nov 22, 2021, 2:30:03 AM11/22/21You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
> This also fails, the following works:
>
> systemctl reload lighttpd.service > /dev/null 2>&1;
That will start lighttpd if it is not running, which might not be
desirable. I think that a different solution is warranted.
/etc/logrotate.d/lighttpd is doing the correct thing, calling
/etc/init.d/lighttpd reopen-logs
However, perhaps /etc/init.d/lighttpd should avoid sending a signal to
lighttpd to reopen logs if lighttpd is not running.
/etc/init.d/lighttpd might check using pidofproc, even though
running start-stop-daemon --oknodo --quiet should have exited 0
if nothing was running.
Does the following work for you?
@@ -92,6 +92,7 @@ case "$1" in
fi
;;
reopen-logs)
+ pidofproc -p "$PIDFILE" "$DAEMON" >/dev/null 2>&1 || exit 0
log_daemon_msg "Reopening $DESC logs" $NAME
if start-stop-daemon --stop --signal HUP --oknodo --quiet \
--pidfile $PIDFILE --exec $DAEMON