diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-04-22 23:23:05 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-04-22 23:53:21 +0200 |
commit | da444ff26f88579b1f3da632ca671f8d49ca1e2b (patch) | |
tree | 30db730f9405713b032f599db37127e0bcb61c4c /nixos | |
parent | 1c849885943b0f536f992c0335a6db6d79c6db08 (diff) | |
download | nixlib-da444ff26f88579b1f3da632ca671f8d49ca1e2b.tar nixlib-da444ff26f88579b1f3da632ca671f8d49ca1e2b.tar.gz nixlib-da444ff26f88579b1f3da632ca671f8d49ca1e2b.tar.bz2 nixlib-da444ff26f88579b1f3da632ca671f8d49ca1e2b.tar.lz nixlib-da444ff26f88579b1f3da632ca671f8d49ca1e2b.tar.xz nixlib-da444ff26f88579b1f3da632ca671f8d49ca1e2b.tar.zst nixlib-da444ff26f88579b1f3da632ca671f8d49ca1e2b.zip |
Turn assertion about oneshot services into a warning
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 4e395899bd3d..52ba31cdeede 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -688,10 +688,9 @@ in config = { - assertions = mapAttrsToList (name: service: { - assertion = service.serviceConfig.Type or "" == "oneshot" -> service.serviceConfig.Restart or "no" == "no"; - message = "${name}: Type=oneshot services must have Restart=no"; - }) cfg.services; + warnings = concatLists (mapAttrsToList (name: service: + optional (service.serviceConfig.Type or "" == "oneshot" && service.serviceConfig.Restart or "no" != "no") + "Service ‘${name}.service’ with ‘Type=oneshot’ must have ‘Restart=no’") cfg.services); system.build.units = cfg.units; |