From 83972b80b46b846f25d2211b242b3f9c748888a9 Mon Sep 17 00:00:00 2001 From: Ben Price Date: Thu, 19 Dec 2019 17:34:22 +0000 Subject: [PATCH] nixos/acme: implement postRun using ExecStartPost In 5532065d0690645f0a813fed6e68163b0f4774d4, acme was changed to be RemainAfterExit=true, but `postRun` commands are implemented as `ExecStopPost`. Systemd now considers the service to be still running after simp_le is finished, so won't run these commands (e.g. to reload certificates in a webserver). Change `postRun` to use `ExecStartPost` to ensure the commands are run in a timely manner. --- nixos/modules/security/acme.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/security/acme.nix b/nixos/modules/security/acme.nix index 8b7d12552ed5..890c421b0ea9 100644 --- a/nixos/modules/security/acme.nix +++ b/nixos/modules/security/acme.nix @@ -241,9 +241,9 @@ in StateDirectoryMode = rights; WorkingDirectory = "/var/lib/${lpath}"; ExecStart = "${pkgs.simp_le}/bin/simp_le ${escapeShellArgs cmdline}"; - ExecStopPost = + ExecStartPost = let - script = pkgs.writeScript "acme-post-stop" '' + script = pkgs.writeScript "acme-post-start" '' #!${pkgs.runtimeShell} -e ${data.postRun} '';