5

On a remote host I have an Apache web server running, and I noticed it has been restarted this morning, as the error log shows :

[Sun Feb 16 07:56:26 2014] [notice] Graceful restart requested, doing restart

I don't think it has been provoked by a human regarding the time of restart, so I am wondering :

  1. What is a "graceful restart request", and what triggers it ?
  2. Is it really needed or is it a better idea to disable it (if I find the culprit) ?

It may be a log-related issue, as the most recent error log files terminates with that line...

7

This is likely due to log rotation that is scheduled to run regularly. In Debian and derived distributions, you can look at /etc/logrotate.d for the log rotation scripts for Apache.

Log rotation is a good practice, this way the log files won't fill up your hard disks.

1

Graceful restart requested is normal in Apache -- part of crontab rotation. If you poke around in your /var/log/auth.log (or equivalent on your distribution) you will see the crontabs being run regularly.

Poke around further by looking at your crontabs: with ls -l /etc/cron* or equivalent on your distro you will find a list of all your crontabs run by root automatically. One of them will be /etc/cron.daily/logrotate which will run the equivalent of

/usr/sbin/logrotate /etc/logrotate.conf 

which in turn has a line within it:

include /etc/logrotate.d

which has a list of log rotation scripts, one of them being /etc/logrotate.d/apache which on mine starts off:

/var/log/apache2/*.log {
    daily

You can adjust it to run more or less frequently if you like, but the base settings on my server are good enough.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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