From c980faebe2cb7592fad47aa2684d10c4ee0a509c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 23 Oct 2012 08:30:50 -0400 Subject: [PATCH] =?UTF-8?q?upstart.nix:=20Set=20=E2=80=98Type=E2=80=99=20t?= =?UTF-8?q?o=20=E2=80=98oneshot=E2=80=99=20for=20Upstart=20tasks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way the service will only reach the "started" state when the task has finished. --- modules/system/upstart/upstart.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/system/upstart/upstart.nix b/modules/system/upstart/upstart.nix index 5761ed4c5a4..33f2775b496 100644 --- a/modules/system/upstart/upstart.nix +++ b/modules/system/upstart/upstart.nix @@ -94,7 +94,9 @@ let if job.daemonType == "none" then { } else throw "invalid daemon type `${job.daemonType}'") // optionalAttrs (!job.task && job.respawn) - { Restart = "always"; }; + { Restart = "always"; } + // optionalAttrs job.task + { Type = "oneshot"; RemainAfterExit = false; }; };