4

I have flask/python2.7/apache2/mod_wsgi app and periodically I can see the following lines in apache log and my application gets restarted:

[mpm_event:notice] AH00493: SIGUSR1 received.  Doing graceful restart
[wsgi:error] Joining threads

I know that such "graceful restart" can happen if there was segfault, but as far as I can see there was no segfault in my case (no corresponding lines in log before line 'doing graceful restart'). Or maybe such event wasn't logged... anyway I suspect this is apache2 issue because mpm_event is apache2 internal entity (docs).

So my questions are:

1) How to check what's wrong in my case?

2) If this is default behavior (restarting if there is no activity for example) rather than issue - how to configure it and where?

Thanks!

1 Answer 1

10

This is because your system has logrotate setup to handle log rotation for Apache. It will send a graceful restart signal to Apache to have it reload while it swaps out the log files.

If this isn't desirable, don't have logrotate do that and use Apache's own mechanism for log file rotation.

1
  • Thank you for the great pointer! In my case the behavior was caused Certbot (letsencrypt). You can check the Certbot activity at /var/log/letsencrypt/letsencrypt.log.
    – fap
    Aug 5, 2021 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.