Comment 3 for bug 2054301

Revision history for this message
thermoman (thermoman) wrote : Re: [worker/event] Some child processes aren't killed on reload (graceful), being stuck in state "Sending Reply", leaves old logfiles open, disk filles up, server stops responding after some days

Workaround so far:

% cat kill_old_apache_processes.sh
#!/bin/sh

# see https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/2054301

wget -qO- http://localhost/server-status \
 | awk -F '</td><td>' '$3 ~ /^yes \(old gen\)$/ {print $2}' \
 | while read pid
 do
  echo "killing $pid"
  kill -9 $pid
  sleep 1
 done

This script will be started via cron every day at 2:00am, 2 hours after logrotate did run.
It will grep /server-status output and look for old processes to be killed.