From 7e57e2c0fb3ddb24e7c1b67986addebcd608b795 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Mon, 14 Mar 2016 00:58:23 +0300 Subject: 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. --- nixos/modules/services/misc/autofs.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/services/misc/autofs.nix b/nixos/modules/services/misc/autofs.nix index 3a95e9228200..8913030e0ea2 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"; -- cgit 1.4.1