autofs service: make service more like upstream one

+6 -3
+6 -3
nixos/modules/services/misc/autofs.nix
··· 75 75 boot.kernelModules = [ "autofs4" ]; 76 76 77 77 systemd.services.autofs = 78 - { description = "Filesystem automounter"; 78 + { description = "Automounts filesystems on demand"; 79 + after = [ "network.target" "ypbind.service" "sssd.service" "network-online.target" ]; 80 + wants = [ "network-online.target" ]; 79 81 wantedBy = [ "multi-user.target" ]; 80 - after = [ "network.target" ]; 81 82 82 83 preStart = '' 83 84 # There should be only one autofs service managed by systemd, so this should be safe. ··· 85 86 ''; 86 87 87 88 serviceConfig = { 88 - ExecStart = "${pkgs.autofs5}/sbin/automount ${if cfg.debug then "-d" else ""} -f -t ${builtins.toString cfg.timeout} ${autoMaster} ${if cfg.debug then "-l7" else ""}"; 89 + Type = "forking"; 90 + PIDFile = "/run/autofs.pid"; 91 + ExecStart = "${pkgs.autofs5}/bin/automount ${optionalString cfg.debug "-d"} -p /run/autofs.pid -t ${builtins.toString cfg.timeout} ${autoMaster}"; 89 92 ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; 90 93 }; 91 94 };