summary refs log tree commit diff
path: root/nixos/modules/services/misc/autofs.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-08-14 13:27:33 +0300
committerNikolay Amiantov <ab@fmap.me>2016-08-14 22:39:23 +0300
commit4a35d089703b034137fa6904183f28a62e2e7977 (patch)
treecb51a6523b8e31c20d45c58298bd5ec401cd44c2 /nixos/modules/services/misc/autofs.nix
parent3e84cbc4caafe95ef17289d52769e65f572d34f7 (diff)
downloadnixpkgs-4a35d089703b034137fa6904183f28a62e2e7977.tar
nixpkgs-4a35d089703b034137fa6904183f28a62e2e7977.tar.gz
nixpkgs-4a35d089703b034137fa6904183f28a62e2e7977.tar.bz2
nixpkgs-4a35d089703b034137fa6904183f28a62e2e7977.tar.lz
nixpkgs-4a35d089703b034137fa6904183f28a62e2e7977.tar.xz
nixpkgs-4a35d089703b034137fa6904183f28a62e2e7977.tar.zst
nixpkgs-4a35d089703b034137fa6904183f28a62e2e7977.zip
autofs service: make service more like upstream one
Diffstat (limited to 'nixos/modules/services/misc/autofs.nix')
-rw-r--r--nixos/modules/services/misc/autofs.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/modules/services/misc/autofs.nix b/nixos/modules/services/misc/autofs.nix
index 8913030e0ea..18f0c3eb83d 100644
--- a/nixos/modules/services/misc/autofs.nix
+++ b/nixos/modules/services/misc/autofs.nix
@@ -75,9 +75,10 @@ in
     boot.kernelModules = [ "autofs4" ];
 
     systemd.services.autofs =
-      { description = "Filesystem automounter";
+      { description = "Automounts filesystems on demand";
+        after = [ "network.target" "ypbind.service" "sssd.service" "network-online.target" ];
+        wants = [ "network-online.target" ];
         wantedBy = [ "multi-user.target" ];
-        after = [ "network.target" ];
 
         preStart = ''
           # There should be only one autofs service managed by systemd, so this should be safe.
@@ -85,7 +86,9 @@ in
         '';
 
         serviceConfig = {
-          ExecStart = "${pkgs.autofs5}/sbin/automount ${if cfg.debug then "-d" else ""} -f -t ${builtins.toString cfg.timeout} ${autoMaster} ${if cfg.debug then "-l7" else ""}";
+          Type = "forking";
+          PIDFile = "/run/autofs.pid";
+          ExecStart = "${pkgs.autofs5}/bin/automount ${optionalString cfg.debug "-d"} -p /run/autofs.pid -t ${builtins.toString cfg.timeout} ${autoMaster}";
           ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
         };
       };