the attached patch is a bit dirty, probably because it has been generated by diffing apache2ctl from different package versions, and I think it has a bug: you call
systemctl start "$APACHE_SYSTEMD_SERVICE"
in the 'restart|graceful)' case stanza, while we want 'systemctl reload' there. I'd also move the need_systemd detection logic out of the "case" to avoid duplication. For the rest I think your proposed solution is essentially correct, thanks for providing it.
Hi RedScourge,
the attached patch is a bit dirty, probably because it has been generated by diffing apache2ctl from different package versions, and I think it has a bug: you call
systemctl start "$APACHE_ SYSTEMD_ SERVICE"
in the 'restart|graceful)' case stanza, while we want 'systemctl reload' there. I'd also move the need_systemd detection logic out of the "case" to avoid duplication. For the rest I think your proposed solution is essentially correct, thanks for providing it.