Subject: Re: bug#46961: Nginx and certbot cervices don't play well togther

From: Clément Lassieur <[email-masked]>
Date: Wed, 31 Jan 2024 01:29:20 +0100

I removed guix-devel, not sure we need to spam it.

On Tue, Jan 30 2024, Carlo Zancanaro wrote:

> +(define %default-deploy-hook
> +  (program-file
> +   "reload-nginx.scm"
> +   (with-imported-modules '((gnu services herd))
> +     #~(begin
> +         (use-modules (gnu services herd))
> +         (with-shepherd-action 'nginx ('reload) result result)))))
> +
>  (define-record-type* <certificate-configuration>
>    certificate-configuration make-certificate-configuration
>    certificate-configuration?
> @@ -65,7 +74,7 @@ (define-record-type* <certificate-configuration>
>    (cleanup-hook        certificate-cleanup-hook
>                         (default #f))
>    (deploy-hook         certificate-configuration-deploy-hook
> -                       (default #f))
> +                       (default %default-deploy-hook))
>    (start-self-signed?  certificate-configuration-start-self-signed?
>                         (default #t)))

I'd reload within ‘certbot-deploy-hook’, between ‘rename-file’ and “(if
deploy-hook-script” so that people don't get surprised, when they use a
deploy-hook for unrelated reasons, that the nginx doesn't reload
anymore.

Plus, reloading nginx is harmless.