mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-26 09:26:00 +03:00
[GH-ISSUE #1546] Ubuntu 18.04 - letsencrypt renew - nginx restart fail #1218
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1218
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @InToSSH on GitHub (Jul 31, 2018).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1546
Impacted versions
Steps to reproduce
Manually run cron task created by installer in /etc/cron.d/letsencrypt
Current behavior
Fails to restart nginx on renewal giving this error:
nginx: [error] invalid PID number "" in "/run/nginx.pid"I was digging around for a bit and found the problem and solution.
Problem is that the cron task contains pre and post-hook with nginx restart,
but also in the /etc/letsencrypt/renewal/<cert_name>.conf there is a pre and post hook specified. So it tries to stop the nginx twice, giving the error that pid file does not exist.
I fixed it by removing the nginx stop/start from the cron task, and removing pre_hook in the config file for nginx stop, and added nginx restart to post_hook in the config file. So the nginx is running for the letsencrypt verification but gets restarted after the renewal and only once.
@vac commented on GitHub (Aug 30, 2018):
I have the same issue. Clean Ubuntu 18.04 Server installation.
@InToSSH: thanks for sharing workaround!
@stefaweb commented on GitHub (Sep 14, 2018):
Hi!
You can replace the original
/etc/cron.d/letsencryptwith:/opt/certbot-auto -q renew --pre-hook 'nginx -t && service stop nginx stop' --post-hook 'nginx -t && service nginx start && service postfix reload && service dovecot reload'This seems to solve the problem.
@tonioo commented on GitHub (Sep 20, 2018):
@InToSSH Thank you for the feedback.
@makakken commented on GitHub (Oct 16, 2018):
@tonioo same on debian 9.5
when i run:
systemctl status nginx.servicei get:
then i run:
/opt/certbot-auto renew --no-self-upgrade --force-renewaland get:
@makakken commented on GitHub (Oct 16, 2018):
after restart everything works fine.
it seems there is a problem in /etc/letsencrypt/renewal/dock.co.conf with . post and pre hooks which is not fixed with
github.com/modoboa/modoboa-installer@e7a9e5fc71