Comment 4 for bug 1979942

Revision history for this message
Bryce Harrington (bryce) wrote :

Still waiting on a reproducer test case for this bug, before we can move forward deploying the fix.

I took a shot at trying myself using the description from the mailing list, but things seem to work as expected and I did not reproduce the failure using the current apache2 2.4.41-4ubuntu3.12 from focal-updates:

host:> lxc login apache2-fix-lp1979942-focal
$ sudo apt-get update
$ sudo apt-get full-upgrade
$ apt-get install apache2

Restart apache2
$ sudo systemctl restart apache2

Verify things are running okay
$ sudo systemctl status apache2
$ ps aux | grep apache2
root 4029 0.0 0.0 6676 4676 ? Ss 23:09 0:00 /usr/sbin/apache2 -k start
www-data 4030 0.0 0.0 1997996 4384 ? Sl 23:09 0:00 /usr/sbin/apache2 -k start
www-data 4031 0.0 0.0 1997996 4384 ? Sl 23:09 0:00 /usr/sbin/apache2 -k start

$ sudo /etc/init.d/apache2 graceful

Verify some apache processes weren't killed
$ ps aux | grep apache2
root 4029 0.0 0.0 6684 5136 ? Ss 23:09 0:00 /usr/sbin/apache2 -k start
www-data 4122 0.0 0.0 1997996 4388 ? Sl 23:11 0:00 /usr/sbin/apache2 -k start
www-data 4123 0.0 0.0 1997996 4388 ? Sl 23:11 0:00 /usr/sbin/apache2 -k start

Notice here that the root process PID 4029 did not restart, but the two
child www-data ones did.

Verify `apachectl fullstatus` shows state is "stopping... no (old gen)"

Perform logrotate
# ls -l /var/log/apache2/
total 28
-rw-r----- 1 root adm 146 Jan 17 23:13 access.log
-rw-r----- 1 root adm 1092 Jan 17 23:11 error.log
-rw-r----- 1 root adm 411 Jan 17 00:00 error.log.1
-rw-r----- 1 root adm 298 Jan 16 00:00 error.log.2.gz
...
# logrotate -l /tmp/apache-rotate.log /etc/logrotate.conf
# ls -l /var/log/apache2/
total 40
-rw-r----- 1 root adm 0 Jan 17 23:14 access.log
-rw-r----- 1 root adm 146 Jan 17 23:13 access.log.1
-rw-r----- 1 root adm 1506 Jan 17 23:14 error.log
-rw-r----- 1 root adm 411 Jan 17 00:00 error.log.1
-rw-r----- 1 root adm 298 Jan 16 00:00 error.log.2.gz

Verify whether the old, rotated logfiles are still kept open
# lsof | grep /apache2.log
# lsof | grep /error.log
apache2 4029 root 2w REG 253,5 1506 656457 /var/log/apache2/error.log
apache2 4224 www-data 2w REG 253,5 1506 656457 /var/log/apache2/error.log
...

There are no logs still open from the old www-data pids, however the
root process PID 4029 does hold open an error.log

Correct me if I'm wrong, but I'm not spotting the described issue from the above steps. Are there additional steps to configure/setup apache, or workloads to apply that will help trigger it?