on one of my Debian 10 system I have to start Apache manually after a renewal of a certificate. It seems that the apache plugin is still running, when certbot tries to restart Apache with the post-hook command.
certbot renew --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Running pre-hook command: systemctl stop apache2
Renewing an existing certificate
Running post-hook command: systemctl start apache2
Despite the post-hook command there is no apache process.
In the syslog I can read “httpd (pid 11348) already running”
Mar 16 11:51:13 openstats systemd: Stopping The Apache HTTP Server…
Mar 16 11:51:13 openstats systemd: apache2.service: Succeeded.
Mar 16 11:51:13 openstats systemd: Stopped The Apache HTTP Server.
Mar 16 11:51:16 openstats systemd: Starting The Apache HTTP Server…
Mar 16 11:51:16 openstats apachectl: httpd (pid 11348) already running
Mar 16 11:51:16 openstats systemd: apache2.service: Succeeded.
Mar 16 11:51:16 openstats systemd: Started The Apache HTTP Server.
The reneval params with pre and post hook are:
account = …
pre_hook = systemctl stop apache2
post_hook = systemctl start apache2
authenticator = apache
installer = apache
server = https://acme-v02.api.letsencrypt.org/directory
I tried “sleep 2 && systemctl start apache2” to delay the post-hook command but this doesnt help. Any idea how to get Apache started again automatically?