Bug#1108939: apache2: logrotate conf uses invoke-rc.d that might be inhibited

Michael Prokop <[email protected]> Sat, 18 Jul 2026 22:11:57 +0200
Newsgroups gmane.linux.debian.devel.apache
Message-ID <2026-07-18T21-54-52__33369.1961642884$1784405607$gmane$org@devnull.michael-prokop.at>
--XcfrKRn81h6Inpeb
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Nicolas George [Tue Jul 08, 2025 at 11:54:10AM +0200]:

> The logrotate snippet for apache2 says:
>=20
> 	postrotate
> 		if pgrep -f ^/usr/sbin/apache2 > /dev/null; then
> 			invoke-rc.d apache2 reload 2>&1 | logger -t apache2.logrotate
> 		fi
> 	endscript
>=20
> It is possible that invoke-rc.d is inhibited by
> policy-rcd-declarative-deny-all or an equivalent solution but apache2
> was enabled and started explicitly.
>=20
> In that case, log rotation should happen, but it does not.
>=20
> Since the call is already wrapped in a test that apache2 is running, I
> suggest to replace =E2=80=9Cinvoke-rc.d apache2 reload=E2=80=9D by =E2=80=
=9Capache2ctl
> graceful=E2=80=9D.

A "graceful reload" should also prevent failures to the apache2 service dur=
ing
logrotate execution whenever new symbols are provided, as could be observed=
 by
users of e.g. the checkmk monitoring system. There the apache2 web service
failed hard whenever new symbols showed up in apache2 packages, and logrota=
te
kicking in during the night then.

This happened in 2024 (2024-07-14), looking like this:

  apache2: Syntax error on line 126 of /omd/sites/monitoring/etc/apache/apa=
che.conf: Cannot load /omd/sites/monitoring/lib/apache/modules/mod_headers.=
so into server: /omd/sites/monitoring/lib/apache/modules/mod_headers.so: un=
defined symbol: ap_set_content_type_ex

Then also in 2025 (2025-09-09):

  apache2: Syntax error on line 133 of /omd/sites/monitoring/etc/apache/apa=
che.conf: Cannot load /omd/sites/monitoring/lib/apache/modules/mod_rewrite.=
so into server: /omd/sites/monitoring/lib/apache/modules/mod_rewrite.so: un=
defined symbol: ap_stat_check

And once again also in 2026 (2026-01-26):

  apache2: Syntax error on line 95 of /omd/sites/monitoring/etc/apache/apac=
he.conf: Cannot load /omd/sites/monitoring/lib/apache/modules/mod_mpm_prefo=
rk.so into server: /omd/sites/monitoring/lib/apache/modules/mod_mpm_prefork=
=2Eso: undefined symbol: ap_set_listentcpdeferaccept

Also see https://forum.checkmk.com/t/apache-failed-with-syntax-error/48244
for further user reports about this.

regards
-mika-

--XcfrKRn81h6Inpeb
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEM8yxNkAa/shDo4djlqh4crfqNzcFAmpb3goACgkQlqh4crfq
Nze8qxAAtm0+ZCFJwxDfqrI65O46q38JXpA1VAhl8Gq3woUPyDXUbHJOBptq9ekm
0Q/5lcrufIEPcyd/WZ7aJgCSEjhFwodH8UU7v0ZjxKuTDDop6VGd/rtgUsWVu7up
t4dnsGTvyjTWaUOZfugDE0zVCn92POP7M8ts5g+/xvdl87+2EUqSDD5sUgOyce9e
CQBmajjmaKvZ1avZ8udiP3H/TRcHIuR0e5dVeJT436limglXMxmEXQiDffb2LPj+
jRc7CQ5dK23sYZYuz7IPMwka0PT7dQ/0lhWEV2dNVTqFHrX7lKYlmOowlNzu4tZn
YZ406gAnwrRcv2ySF0qRHrc5zPI+seifJh5tWrQnfFrEQLv8obwPxaD2BYK5u8U/
qPjlTfimrxl8PbJLwzusoikRH3m0TSXkIA2Jlj44OpwfKHicYRgq1Ew/u3v/yA/d
/MfFZ7DCmAgSz3Ib30xTrZW/VNRPuIlXGBOYAgdxxiyU4q9med+Xwl6HiqjTgLzT
A4BgDRy7kfwcwSgRafsHa7cevoD7FF9MKbYmkghOAbi8BiOXtOBZwgTYv0sR2bTS
jhCLHeF4a3BqPWc4RBjBkUY021H9PcKVpsTYJ+qkBGSibNByhsb3a7HyxtxnxOkw
B71B8c2duRcr0w4AgxHl1X+IiKRMov/dVHjKPZV6R3FK2Jkq570=
=plwX
-----END PGP SIGNATURE-----

--XcfrKRn81h6Inpeb--