certbot-apache: use httpd by default for CentOS/RHEL
Fixes #9386
CentOS and RHEL 9 now use httpd instead of apachectl, so that's now the default for that configurator. There's now a special case for older CentOS/RHEL versions to use apachectl, as well as for older Fedora (<28).
Code looks solid, have you already tested it on CentOS/RHEL 8/9 in practice?
This seems like it will now leave self.options.restart_cmd_alt[0] set to "httpd" in some cases, which looks wrong, since httpd restart is not a valid way to invoke httpd. (Though I am not sure how certbot uses restart_cmd_alt so may be missing something)
On all versions of CentOS, RHEL and Fedora it is fine to restart httpd using apachectl restart.
The special case needed is if you want to do something other than control the daemon, e.g. httpd -t or httpd -v in some form, you should run httpd directly.
Ah, thanks for the clarification @notroj, turns out I misunderstood the RHEL changelog! Updating the PR
@bmw i reworked this into a single class, ready for review again!
CHANGELOG entry needs to be moved from 1.25.0 to 1.32.0.
d'oh, good catch @alexzorin. fixed here: https://github.com/certbot/certbot/pull/9444
Yeah thanks for catching this Alex. This recurring issue motivates me a bit to take another look at https://github.com/certbot/certbot/issues/8272.