Skip to content

Certificate service renewal #431

Open
@oscgonfer

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:

  1. Setup fabmanager following setup script
  2. Choose to autorenew certificate
  3. 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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions