Open
Description
Describe the bug
There is an issue with the letsencrypt.service
. The certificate renewal works fine, but not the restarting of the nginx container.
To Reproduce
Steps to reproduce the behavior:
- Setup fabmanager following setup script
- Choose to autorenew certificate
- Wait and check the status for the letsencrypt service or trigger it
Expected behavior
A renewal of the certificate (OK) and relaunching of the nginx (NOK)
Server
Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-124-generic x86_64)
docker --version
Docker version 20.10.17, build 100c701
I think it's simply a problem with the name of the container. At least in our deployment scenario, containers are named using dashes, instead of underscores:
[Unit]
Description=letsencrypt cert update oneshot
Requires=docker.service
[Service]
Type=oneshot
ExecStart=/usr/bin/docker run --rm --name certbot_fabmanager -v "/apps/fabmanager/letsencrypt/etc:/etc/letsencrypt" certbot/certbot:latest -c "/etc/letsencrypt/config/webroot.ini" certonly
ExecStartPost=-/usr/bin/docker restart fabmanager_nginx_1
In our case should replace the ExecStartPost
line by (note also the dash before /usr/bin
?):
ExecStartPost=/usr/bin/docker restart fabmanager-nginx-1