Your message dated Mon, 22 Nov 2021 12:46:21 +0100
with message-id
<CAJ2a_DfkzZsBuM5FXNXdQLLtR=yszf1xatksbe5jxnnynlo...@mail.gmail.com>
and subject line Re: Bug#1000310: lighttpd: logrotate fails if service is not
running
has caused the Debian Bug report #1000310,
regarding lighttpd: logrotate fails if service is not running
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1000310: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000310
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: lighttpd
Version: 1.4.61-1
File: /etc/logrotate.d/lighttpd
When the lighttpd service is not active, logrotate fails:
systemd[1]: Starting Rotate log files...
logrotate[402728]: lighttpd.service is not active, cannot reload.
logrotate[402723]: error: error running shared postrotate script for
'/var/log/lighttpd/*.log '
systemd[1]: logrotate.service: Main process exited, code=exited,
status=1/FAILURE
systemd[1]: logrotate.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Rotate log files.
Please consider reloading only when active, e.g.:
systemctl -q is-active lighttpd.service && systemctl reload lighttpd.service
--- End Message ---
--- Begin Message ---
On Mon, 22 Nov 2021 at 08:16, Glenn Strauss <[email protected]> wrote:
>
> 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
>
True, the issue was caused by a local modification of
/etc/logrotate.d/lighttpd, the package default works fine.
Sorry for the inconvenience.
> 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
--- End Message ---