1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

systemd: oneshot units should be allowed to restart on failure/abort

This commit is contained in:
Mathijs Kwik 2014-04-17 15:20:39 +02:00
parent d17af6b9a8
commit c1e638abb6

View file

@ -637,7 +637,8 @@ in
config = {
assertions = mapAttrsToList (name: service: {
assertion = service.serviceConfig.Type or "" == "oneshot" -> service.serviceConfig.Restart or "no" == "no";
assertion = service.serviceConfig.Type or "" == "oneshot" ->
builtins.elem (service.serviceConfig.Restart or "no") ["no" "on-failure" "on-abort"];
message = "${name}: Type=oneshot services must have Restart=no";
}) cfg.services;