Ask Your Question
3

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

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

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

Comments

3

The command you are looking for is

[sudo] apachectl graceful

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

for another command, refer to http://fedoraproject.org/wiki/Systemd

surbakti gravatar imagesurbakti ( 2012-11-11 07:28:24 -0600 )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 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
1

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

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

Comments

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 -0600 )edit
0

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

@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
0

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

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

Stats

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

Seen: 38,830 times

Last updated: Dec 17 '12