Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Apache 2.2.3 on CentOS 5.5 and just noticed the following logrotate postrotate configuration in /etc/logrotate.d/httpd:

/sbin/service httpd reload > /dev/null 2>/dev/null || true

Since this is set to run once per week, it does a hard reload for Apache, which seemingly kills all connections (is this right? I'm not an expert). Would it be safer to change the postrotate script to a graceful restart instead?

/usr/sbin/apachectl graceful > /dev/null

This is the postrotate behavior I already have for my virtual hosts. I don't understand why the httpd rotate scripts needs to do a hard reload.

Any advice on how to configure this properly will be greatly appreciated.

Thanks, Ralph

share|improve this question
up vote 0 down vote accepted

No, the '/sbin/service httpd reload' command does not kill all connections as it does not initiate a 'hard restart'. CentOS triggers Apache via service, other OSs do via init scripts. For all of them a 'reload' means a graceful restart/sending Apache the USR1 signal:

"The USR1 or graceful signal causes the parent process to advise the children to exit after their current request (or to exit immediately if they're not serving anything). The parent re-reads its configuration files and re-opens its log files. As each child dies off the parent replaces it with a child from the new generation of the configuration, which begins serving new requests immediately."

share|improve this answer
Thanks for your detailed reply. When I look at the server-status page, however, the Server Uptime usually resets after 7 days. Is this normal behavior then? I just want to make sure my Apache isn't restarting more than necessary. – Ralph Apr 24 '11 at 4:19
Hmm, if the server uptime at the server-status page gets reset every 7 days, then your Apache seems to get indeed restarted regularly. Did you checked your /etc/crontab as well as the scripts in the /etc/cron.weekly/ folder? – desasteralex Apr 24 '11 at 5:21
-1 See the answer by idleyoungman. From the documentation, a reload "causes it to kill off its children like in TERM, but the parent doesn't exit. It re-reads its configuration files, and re-opens any log files." – Andomar Nov 14 '15 at 11:05

The original answer is not correct. The initscript "reload" just passes the reload command to apachectl. A reload sends SIGHUP to httpd, which immediately terminates the child processes and does interrupt currently connected clients:

See a bug filed against the RHEL httpd package:

The reason graceful is not used in the logrotate script is because there's no way to guarantee the the child processes have stopped:

share|improve this answer
+1 Can confirm from testing that this is true – Andomar Nov 14 '15 at 11:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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