summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2016-11-19 15:12:42 +0100
committerRobert Helgesson <robert@rycee.net>2016-11-25 21:49:34 +0100
commit8a424e3fbd30b54d73b91fa8841ac82d2af75a9a (patch)
tree6647a21dcf49f3936fe783f4d62d308810e8e39c
parentbaea6a8d824c3ac4b1a32f43fa1987090a7bf08d (diff)
downloadnixlib-8a424e3fbd30b54d73b91fa8841ac82d2af75a9a.tar
nixlib-8a424e3fbd30b54d73b91fa8841ac82d2af75a9a.tar.gz
nixlib-8a424e3fbd30b54d73b91fa8841ac82d2af75a9a.tar.bz2
nixlib-8a424e3fbd30b54d73b91fa8841ac82d2af75a9a.tar.lz
nixlib-8a424e3fbd30b54d73b91fa8841ac82d2af75a9a.tar.xz
nixlib-8a424e3fbd30b54d73b91fa8841ac82d2af75a9a.tar.zst
nixlib-8a424e3fbd30b54d73b91fa8841ac82d2af75a9a.zip
tahoe service: use ExecStart instead of script
Since only a single command is necessary to start Tahoe it is sufficient
to use ExecStart and thereby skip starting up Bash (and leaving it
running).
-rw-r--r--nixos/modules/services/network-filesystems/tahoe.nix24
1 files changed, 12 insertions, 12 deletions
diff --git a/nixos/modules/services/network-filesystems/tahoe.nix b/nixos/modules/services/network-filesystems/tahoe.nix
index f91827c379de..ab9eac3829fb 100644
--- a/nixos/modules/services/network-filesystems/tahoe.nix
+++ b/nixos/modules/services/network-filesystems/tahoe.nix
@@ -233,6 +233,12 @@ in
             serviceConfig = {
               Type = "simple";
               PIDFile = pidfile;
+              # Believe it or not, Tahoe is very brittle about the order of
+              # arguments to $(tahoe start). The node directory must come first,
+              # and arguments which alter Twisted's behavior come afterwards.
+              ExecStart = ''
+                ${settings.package}/bin/tahoe start ${nodedir} -n -l- --pidfile=${pidfile}
+              '';
             };
             preStart = ''
               if [ \! -d ${nodedir} ]; then
@@ -248,12 +254,6 @@ in
               # ln -s /etc/tahoe-lafs/introducer-${node}.cfg ${nodedir}/tahoe.cfg
               cp /etc/tahoe-lafs/introducer-${node}.cfg ${nodedir}/tahoe.cfg
             '';
-            # Believe it or not, Tahoe is very brittle about the order of
-            # arguments to $(tahoe start). The node directory must come first,
-            # and arguments which alter Twisted's behavior come afterwards.
-            script = ''
-              tahoe start ${nodedir} -n -l- --pidfile=${pidfile}
-            '';
           });
         users.extraUsers = flip mapAttrs' cfg.introducers (node: _:
           nameValuePair "tahoe.introducer-${node}" {
@@ -333,6 +333,12 @@ in
             serviceConfig = {
               Type = "simple";
               PIDFile = pidfile;
+              # Believe it or not, Tahoe is very brittle about the order of
+              # arguments to $(tahoe start). The node directory must come first,
+              # and arguments which alter Twisted's behavior come afterwards.
+              ExecStart = ''
+                ${settings.package}/bin/tahoe start ${nodedir} -n -l- --pidfile=${pidfile}
+              '';
             };
             preStart = ''
               if [ \! -d ${nodedir} ]; then
@@ -348,12 +354,6 @@ in
               # ln -s /etc/tahoe-lafs/${node}.cfg ${nodedir}/tahoe.cfg
               cp /etc/tahoe-lafs/${node}.cfg ${nodedir}/tahoe.cfg
             '';
-            # Believe it or not, Tahoe is very brittle about the order of
-            # arguments to $(tahoe start). The node directory must come first,
-            # and arguments which alter Twisted's behavior come afterwards.
-            script = ''
-              tahoe start ${nodedir} -n -l- --pidfile=${pidfile}
-            '';
           });
         users.extraUsers = flip mapAttrs' cfg.nodes (node: _:
           nameValuePair "tahoe.${node}" {