From 3a2790c3426b59a6836a0441c77d4668e09bbcb7 Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Sun, 1 Mar 2020 16:00:01 -0500 Subject: [PATCH] services.mailman: RemainAfterExit so settings take effect properly Prior to this fix, changes to certain settings would not be applied automatically and users would have to know to manually restart the affected service. A prime example of this is `services.mailman.hyperkitty.baseUrl`, or various things that affect `mailman3/settings.py` --- nixos/modules/services/mail/mailman.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/modules/services/mail/mailman.nix b/nixos/modules/services/mail/mailman.nix index 43dc185cdd77..f5e78b182933 100644 --- a/nixos/modules/services/mail/mailman.nix +++ b/nixos/modules/services/mail/mailman.nix @@ -265,6 +265,11 @@ in { ''; serviceConfig = { Type = "oneshot"; + # RemainAfterExit makes restartIfChanged work for this service, so + # downstream services will get updated automatically when things like + # services.mailman.hyperkitty.baseUrl change. Otherwise users have to + # restart things manually, which is confusing. + RemainAfterExit = "yes"; }; }; @@ -282,6 +287,9 @@ in { serviceConfig = { User = cfg.webUser; Type = "oneshot"; + # Similar to mailman-settings.service, this makes restartTriggers work + # properly for this service. + RemainAfterExit = "yes"; WorkingDirectory = "/var/lib/mailman-web"; }; };