While running apache I noticed that, from time to time, logs were emptied and nothing more was written on them anymore. This is caused by logrotate file, it doesn't take into account systemd and, then, it causes this mess It should probably be modified to something like this: /var/log/apache2/*log { missingok notifempty sharedscripts postrotate if test -d /run/systemd/system ; then systemctl reload apache2.service > /dev/null 2>&1 || true else /etc/init.d/apache2 reload > /dev/null 2>&1 || true fi endscript } Thanks
Related problem: $ cat /usr/sbin/apache2ctl #!/bin/sh exec /etc/init.d/apache2 "$@"
What is using that helper?
Well, at the end is providing this: /var/log/apache2/*log { missingok notifempty sharedscripts postrotate if test -d /run/systemd/system ; then systemctl reload apache2.service > /dev/null 2>&1 || true else /etc/init.d/apache2 reload > /dev/null 2>&1 || true fi endscript } In gentoo-patches tarball (under scripts subdir)
this is still needed... could it be changed please? Thanks
If you could provide a git-formatted patch against https://gitweb.gentoo.org/proj/apache.git/ I'd appreciate that very much. I still don't use systemd on any Gentoo instance where I run apache so I cannot test it reliably.
Created attachment 686469 [details, diff] 0001-2.4-scripts-apache2-logrotate-handle-systemd.patch Let's see if I created it correctly... I am not used to git format-patch :/ Thanks
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/apache.git/commit/?id=64371485b30887df6097de53f106803ecc746dae commit 64371485b30887df6097de53f106803ecc746dae Author: Pacho Ramos <pachoramos@gmail.com> AuthorDate: 2021-02-12 14:09:08 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2021-02-12 14:26:22 +0000 2.4/scripts/apache2-logrotate: handle systemd Bug: https://bugs.gentoo.org/646032 Signed-off-by: Pacho Ramos <pacho@gentoo.org> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org> 2.4/scripts/apache2-logrotate | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2107343b4a5852b387f0b0dc61a435194f60fd1 commit d2107343b4a5852b387f0b0dc61a435194f60fd1 Author: Lars Wendler <polynomial-c@gentoo.org> AuthorDate: 2021-02-12 14:30:26 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2021-02-12 14:32:23 +0000 www-servers/apache: Revbump to fix logrotate on systemd Thanks-to: Pacho Ramos <pacho@gentoo.org> Closes: https://bugs.gentoo.org/646032 Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org> www-servers/apache/Manifest | 1 + www-servers/apache/apache-2.4.46-r6.ebuild | 257 +++++++++++++++++++++++++++++ 2 files changed, 258 insertions(+)