Report this

What is the reason for this report?

Graceful restart requested, doing restart

Posted on November 9, 2013

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/5.4.17-5+debphp.org~precise+1 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!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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 <br> <br>[Sun Jan 26 06:36:23 2014] [notice] Graceful restart requested, doing restart <br> <br>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. <br> <br>I have seen a suggestion in another forum (http://forums.cpanel.net/f5/apache-graceful-restart-requested-log-file-158026.html#post664414) 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. <br> <br>http://dripuonlinux.wordpress.com/2013/02/08/apache-undergoing-graceful-restart-every-two-hours/ - 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? <br> <br>http://us.generation-nt.com/answer/gentoo-user-apache-what-could-cause-graceful-restart-requested-help-204315671.html - This post seems to confirm my thought that it may related to logrotate. I read further down the thread (http://us.generation-nt.com/answer/gentoo-user-apache-what-could-cause-graceful-restart-requested-help-204315671.html#204316391) and see the specific information from logrotate as well as answers from posters about why the graceful restart is necessary. <br> <br>I’m going to look into my logrotate configuration now.

Indeed, here is my logrotate configuration for apache: <br> <br>/var/log/apache2/*.log { <br> weekly <br> missingok <br> rotate 52 <br> compress <br> delaycompress <br> notifempty <br> create 640 root adm <br> sharedscripts <br> postrotate <br> /etc/init.d/apache2 reload > /dev/null <br> endscript <br> prerotate <br> if [ -d /etc/logrotate.d/httpd-prerotate ]; then
<br> run-parts /etc/logrotate.d/httpd-prerotate;
<br> fi;
<br> endscript <br>} <br> <br>Notice that it is done weekly and it issues a reload postrotation. I think the mystery is solved. <br> <br><tangent>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!</tangent>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.