Code: Select all
cat /var/log/apache2/error_log | grep -E 'segfault|SIGTERM'Code: Select all
[Wed Aug 03 21:16:59 2005] [warn] child process 11125 still did not exit, sending a SIGTERM
[Wed Aug 03 21:16:59 2005] [warn] child process 16947 still did not exit, sending a SIGTERM
[Wed Aug 03 21:16:59 2005] [warn] child process 16917 still did not exit, sending a SIGTERM
[Wed Aug 03 21:17:01 2005] [warn] child process 11125 still did not exit, sending a SIGTERM
[Wed Aug 03 21:17:01 2005] [warn] child process 16947 still did not exit, sending a SIGTERM
[Wed Aug 03 21:17:01 2005] [warn] child process 16917 still did not exit, sending a SIGTERM
[Wed Aug 03 21:17:03 2005] [warn] child process 11125 still did not exit, sending a SIGTERM
[Wed Aug 03 21:17:03 2005] [warn] child process 16917 still did not exit, sending a SIGTERM
[Wed Aug 03 21:17:05 2005] [error] child process 11125 still did not exit, sending a SIGKILL
[Wed Aug 03 21:17:06 2005] [notice] caught SIGTERM, shutting downCode: Select all
#LoadModule auth_digest_module modules/mod_auth_digest.soCode: Select all
RESTARTSTYLE="graceful"
to
RESTARTSTYLE="restart"That was the issue I was having.hanj wrote:Sometimes when logrotate is rotating the scripts.. it tries to restart apache before all the child process have died. I've run into this problem on one server.. where I had to make it sleep for 10 seconds before the 'start' call.
Have you grep'd through your error_logs and looked for segfault?
I think the answer will be around that point. Once you find a time of the fault.. you can less the file and see what happened before the the fault.Code: Select all
cat /var/log/apache2/error_log | grep -E 'segfault|SIGTERM'
strace won't do you much.. unless you can replicate the fault. Meaning.. if you know a certain PHP script crashes apache.. you can run strace and see where apache died.
hanji
Code: Select all
/bin/kill -HUP `cat /var/run/apache2.pid` 1> /dev/null || trueCode: Select all
/etc/init.d/apache2 restart 1> /dev/null || trueMe too... I don't understand why this works can you explain what this is doing?deoren wrote: After changingtoCode: Select all
/bin/kill -HUP `cat /var/run/apache2.pid` 1> /dev/null || truethere were no more segfaults.Code: Select all
/etc/init.d/apache2 restart 1> /dev/null || true
Here are the relevant sections of /etc/init.d/apache2:Sometimes when logrotate is rotating the scripts.. it tries to restart apache before all the child process have died.
Code: Select all
start() {
checkconfig || return 1
ebegin "Starting apache2"
[ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
[ -f /usr/lib/apache2/build/envvars ] && . /usr/lib/apache2/build/envvars
env -i PATH=$PATH /sbin/start-stop-daemon --quiet \
--start --startas /usr/sbin/apache2 \
--pidfile ${PIDFILE} -- -k start ${APACHE2_OPTS}
eend $?
}
stop() {
ebegin "Stopping apache2"
/usr/sbin/apache2ctl stop >/dev/null
start-stop-daemon -o --quiet --stop --pidfile ${PIDFILE}
eend $?
}