The server crashes after receiving 2 SIGUSR1 within a very short timeframe. I personally ran into this problem by using a logrotate script that sends SIGUSR1 after each individual logrotation. The last lines in error_log are [Sat Jun 10 03:51:10 2006] [notice] SIGUSR1 received. Doing graceful restart [Sat Jun 10 03:51:10 2006] [notice] Digest: generating secret for digest authentication ... [Sat Jun 10 03:51:11 2006] [crit] (4)Interrupted system call: Digest: error generating secret: Interrupted system call Configuration Failed The problem seems to be located in apr_generate_random_bytes() which is called by mod_auth_digest. It returns a failure on receiving a signal while reading from /dev/random. Applying the following patch should fix the problem: diff --recursive httpd-2.0.58/srclib/apr/misc/unix/rand.c httpd-2.0.58-fixed/srclib/apr/misc/unix/rand.c 70c70,73 < return errnum; --- > if (errnum == EINTR) > fd = -1; /* force open() again if read() was interrupted */ > else > return errnum;
I think I just ran into this problem. error_log: [Sat Jul 29 03:10:01 2006] [notice] Digest: generating secret for digest authentication ... [Sat Jul 29 03:10:01 2006] [notice] Digest: done [Sat Jul 29 03:10:01 2006] [notice] Apache configured -- resuming normal operations [Sat Jul 29 03:10:02 2006] [notice] Graceful restart requested, doing restart [Sat Jul 29 03:10:03 2006] [notice] Digest: generating secret for digest authentication ... [Sat Jul 29 03:10:03 2006] [notice] Digest: done [Sat Jul 29 03:10:03 2006] [notice] Apache configured -- resuming normal operations [Sat Jul 29 03:10:05 2006] [notice] Graceful restart requested, doing restart [Sat Jul 29 03:10:05 2006] [notice] Digest: generating secret for digest authentication ... [Sat Jul 29 03:10:05 2006] [notice] Digest: done [Sat Jul 29 03:10:06 2006] [notice] Apache configured -- resuming normal operations [Sat Jul 29 03:10:06 2006] [notice] Graceful restart requested, doing restart [Sat Jul 29 03:10:06 2006] [notice] Digest: generating secret for digest authentication ... [Sat Jul 29 03:10:06 2006] [notice] Digest: done [Sat Jul 29 03:10:06 2006] [notice] Apache configured -- resuming normal operations [Sat Jul 29 03:10:06 2006] [notice] Graceful restart requested, doing restart [Sat Jul 29 03:10:06 2006] [notice] Digest: generating secret for digest authentication ... [Sat Jul 29 03:10:06 2006] [crit] (4)Interrupted system call: Digest: error generating secret: Interrupted system call Configuration Failed Server version: Apache/2.0.58
I also just got this problem - at 03:10 too - this is when my logs rotate, so preumably is caused by the 'reload' that logrotate does: /var/log/apache2/*log { missingok notifempty sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null 2>&1 || true endscript }
This is a bug in apr_generate_random_bytes, it should handle EINTR.
Fixed on the trunk - thanks for the report. http://svn.apache.org/viewvc?view=rev&revision=553146