As of 20.04, the systemd service definition for apache2
(focal-updates Launchpad link) uses apachectl stop
for ExecStop. This corresponds to the immediate, connection-disrupting TERM signal, instead of the graceful WINCH shutdown signal provided by apachectl graceful-stop
.
Why is this? It seems to me like it's more sensible to do graceful shutdowns by default, especially since the same systemd service file specifies ExecReload to do a graceful
restart instead of the abrupt restart
. Also, nginx
uses the graceful shutdown QUIT signal for its own ExecStop config.
There may well be a documented discussion in some mailing list about this decision, but I'm new to exploring the Ubuntu dev community platforms so I don't know yet where to look. (Maybe it's a design decision inherited from Debian, but I also can't tell.)
As a secondary question: if I want to update this service config for Apache (or any Ubuntu systemd service in general), how do I go about it in a safe, ‘Ubuntu-approved’ manner? (i.e., ensure it won't be overwritten by updates, etc.)