summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-03-14 00:58:23 +0300
committerNikolay Amiantov <ab@fmap.me>2016-03-14 01:02:40 +0300
commit7e57e2c0fb3ddb24e7c1b67986addebcd608b795 (patch)
tree4c989d9f8ae4316c19243e4aecd5f25e45955b68
parent7da494b8ae68c398fc2a18f0f5040679f8d2188f (diff)
downloadnixpkgs-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar
nixpkgs-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.gz
nixpkgs-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.bz2
nixpkgs-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.lz
nixpkgs-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.xz
nixpkgs-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.zst
nixpkgs-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.zip
autofs service: clear lockfile before start
autofs uses a lock file in /tmp to check if it's running -- unclean
shutdown breaks the service until one manually removes it.
-rw-r--r--nixos/modules/services/misc/autofs.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/autofs.nix b/nixos/modules/services/misc/autofs.nix
index 3a95e922820..8913030e0ea 100644
--- a/nixos/modules/services/misc/autofs.nix
+++ b/nixos/modules/services/misc/autofs.nix
@@ -79,6 +79,11 @@ in
         wantedBy = [ "multi-user.target" ];
         after = [ "network.target" ];
 
+        preStart = ''
+          # There should be only one autofs service managed by systemd, so this should be safe.
+          rm -f /tmp/autofs-running
+        '';
+
         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 ""}";
           ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";