Graceful restart requested, doing restart

Posted November 9, 2013 30.7k views
Hello, every sunday morning my Ubuntu server does a restart and I dont know why. These are the messages from the log files: [Sun Nov 03 07:35:03 2013] [notice] Graceful restart requested, doing restart [Sun Nov 03 07:35:04 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/ configured -- resuming normal operations (If it has to do anything with PHP I used these lines when I updated PHP to version 5.4) : sudo apt-get install python-software-properties apt-get dist-upgrade sudo apt-get upgrade sudo add-apt-repository ppa:ondrej/php5-oldstable sudo apt-get update sudo apt-get upgrade Thanks in advance!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

8 answers
Please pastebin the whole log file. Upgrading php restarts apache automatically but I don't think you're upgrading php every week so the whole log file would help :]
Thanks for your answer Kamal,

No ofc im not, but since I have no idea whats causing the restart I just thought php could have something to do with it since I saw it in the log.

Since it was sunday yday I got the same message.

[Sun Nov 10 07:35:02 2013] [notice] Graceful restart requested, doing restart
[Sun Nov 10 07:35:03 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/ configured -- resuming normal operations

Thats everything from the log "/var/log/apache2/error.log" The rest in the log is just some simple php errors which has nothing to do with it.

Thanks in advance
Odd. Apparently Apache gracefully restarts when editing config files but gracefully restarting/reloading *every* sunday is weird.
I am seeing this happen on my server as well. I'll continue to monitor the logs and see if it is happening at other times when I have not requested it. Here is the line from when it happened this morning

[Sun Jan 26 06:36:23 2014] [notice] Graceful restart requested, doing restart

This server is located in NYC2 and I have not changed the timezone setting of the server. I can assure you that I did not request the restart at this time.

I have seen a suggestion in another forum ( that configuration settings may need to be adjusted and am assuming that's where people are able to adjust their apache configuration. However, if this is really an issue with apache config, it should happen at various unpredictable times and not always on a Sunday. I don't believe that I am seeing it happen at other times when I have not requested it.
I looked through more of the results I got from searching on "apache2 graceful restart" and am including some results that may (although I'm not certain -- see comments with each) be relevant. - the interesting point is that the poster says it is related to log processing. However, the solution provided deals with configuring cPanel. So, I'm not sure this really applies to us on D.O. Perhaps I should look into the logrotate settings and see if it just so happens that something happens every Sunday? - This post seems to confirm my thought that it may related to logrotate. I read further down the thread ( and see the specific information from logrotate as well as answers from posters about why the graceful restart is necessary.

I'm going to look into my logrotate configuration now.
Indeed, here is my logrotate configuration for apache:

/var/log/apache2/*.log {
rotate 52
create 640 root adm
/etc/init.d/apache2 reload > /dev/null
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \

Notice that it is done weekly and it issues a reload postrotation. I think the mystery is solved.

For me, this actually has a nice side benefit that my APC cache will automatically be flushed once a week. The thing that had triggered me to look into this in the first place was that I was inspecting my APC cache statistics and noticed that it was using less memory than I expected. I was concerned that it had filled up, but saw that cache full was zero. Then I noticed that it had been running for just over an hour. So, I checked my log files and noticed the Graceful restart. And, now here we are at the resolution. Cheers!
Ah, sorry. I had wrapped the last paragraph in a set of tangent tags, but they are being hidden; apparently they are being interpreted as actual HTML markup and being stripped as unrecognized. I guess I needed to use < and > notation. (Let's see if the HTML entity coding works.)
If you run cPanel on your server you can fix this by going to WHM panel at:
Service Configuration » Apache Configuration » Piped Log Configuration, checkbox "Enable Piped Apache Logs" then "Save".

That worked for me on CentOS 6.5.
Submit an Answer