diff options
author | Nikolay Amiantov <ab@fmap.me> | 2016-03-14 00:58:23 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2016-03-14 01:02:40 +0300 |
commit | 7e57e2c0fb3ddb24e7c1b67986addebcd608b795 (patch) | |
tree | 4c989d9f8ae4316c19243e4aecd5f25e45955b68 | |
parent | 7da494b8ae68c398fc2a18f0f5040679f8d2188f (diff) | |
download | nixlib-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar nixlib-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.gz nixlib-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.bz2 nixlib-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.lz nixlib-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.xz nixlib-7e57e2c0fb3ddb24e7c1b67986addebcd608b795.tar.zst nixlib-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.nix | 5 |
1 files changed, 5 insertions, 0 deletions
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"; |