Ask Your Question

How do I do a graceful restart of Apache httpd with systemd?

asked 2012-11-08 20:12:09 -0500

mattdm gravatar image

In the old model, to do a graceful restart of httpd (without breaking existing connections), I would do

sudo service httpd graceful

But in the new world of systemctl, there's no such option. What should I do instead?

edit retag flag offensive close merge delete



The command you are looking for is

[sudo] apachectl graceful

jmt gravatar imagejmt ( 2012-11-08 22:47:47 -0500 )edit

for another command, refer to

surbakti gravatar imagesurbakti ( 2012-11-11 07:28:24 -0500 )edit

I guess so. It sure was nice to have all of the control options in once place before rather than having to search for the appropriate control command for each program. Oh well.

mattdm gravatar imagemattdm ( 2013-01-10 09:41:21 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2012-12-17 11:38:54 -0500

David Strauss gravatar image

But in the new world of systemctl, there's no such option.

That's actually incorrect. The equivalent command on systemctl is reload, which does a graceful restart if one is configured for the service.

This is documented in the systemctl man page:

In other words: for the example case of Apache, this will reload Apache's httpd.conf in the web server, not the apache.service systemd unit file.

edit flag offensive delete link more


A graceful restart isn't just a reload of the configuration file, though. It actually does a complete stop and start, just not abruptly.

mattdm gravatar imagemattdm ( 2013-01-10 09:40:44 -0500 )edit

answered 2017-10-17 04:11:35 -0500

@darkfader "systemctl reload httpd" DOES fire "/usr/sbin/httpd -k graceful" or what do you think the line "ExecReload=/usr/sbin/httpd $OPTIONS -k graceful" does?

edit flag offensive delete link more

answered 2017-01-04 18:47:29 -0500

mattdm is right, this is a critical difference. you can lose countless hours debugging until you finally find out that some module changes are not triggered by a "reload". The only way to still get a working system is using /usr/sbin/httpd -k graceful.

edit flag offensive delete link more

Question Tools


Asked: 2012-11-08 20:12:09 -0500

Seen: 39,039 times

Last updated: Dec 17 '12