1

I'm using apache (with mod_wsgi and django), and everything works fine, except rather strangely once per week apache seems to shutdown, and I have to login to the server to restart it to get my sites back up.

Each week this happens at around 06:30-06:45 Sun or Mon morning. The apache error logs for a given site just show:

#/var/log/apache2/error.log
[Mon Aug 18 06:30:01.564916 2014] [mpm_event:notice] [pid 5576:tid 140263321876352] AH00493: SIGUSR1 received.  Doing graceful restart
[Mon Aug 18 06:30:02.473446 2014] [core:notice] [pid 5576] AH00060: seg fault or similar nasty error detected in the parent process

and

 #/srv/apache/log/error-ssl.log (site specific `ErrorLog` set in vhost)    
[Sun Jul 27 06:42:47.610600 2014] [:info] [pid 3712:tid 140600110684032] mod_wsgi (pid=3712): Shutdown requested 'mysite.co.uk'.
[Sun Jul 27 06:42:47.610706 2014] [:info] [pid 3712:tid 140600110684032] mod_wsgi (pid=3712): Stopping process 'mysite.co.uk'.
.

At first I thought maybe a weekley cron job, but I see nothing in /var/log/syslog that looks like an obvious candidate for causing the conflict.

Does anyone know what this could be or could provide steps I can take to further debug the error?

fpghost
  • 663
  • 1
  • 10
  • 22
  • 1
    Another place to look might be logrotate which restarts/reloads your webserver to make it release the old log file and start writing in the new. – HBruijn Aug 18 '14 at 09:04
  • Thanks for the tip. How would I actually go about checking if it is logrotate causing the issue? By the way I also added the `/var/log/apache2/error.log` that I missed originally in my OP. – fpghost Aug 18 '14 at 14:04
  • I found the apache rotate script in `/etc/logrotate.d/` and tried manually a `/etc/init.d/apache2 reload`. This didn't crash apache2, but I'm not sure if that is a valid test of it being the rotate script or not... – fpghost Aug 18 '14 at 14:09
  • The `/var/lib/logrotate/status` does show my site specific logs being rotated at the time of the most recent crash this morning though: `"/srv/apache/log/mysite.com_access.log" 2014-8-18-6:30:1` so maybe you are on to something here... – fpghost Aug 18 '14 at 14:14
  • Possibly it is sending the wrong signal to Apache. It should not be using SIGINT, but from memory SIGHUP (restart) or SIGUSR1 (graceful restart). – Graham Dumpleton Aug 18 '14 at 23:12
  • But the log does say SIGUSR1 (graceful), it just fails. I also just can't seem to reproduce this from command line with and restart or reload command. – fpghost Aug 24 '14 at 12:14

0 Answers0