From 7b88c9c6443f7eda2053669b67235721e2f68de3 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 13 Nov 2024 12:05:31 +0000 Subject: [PATCH] sane.fs: dont have local-fs.target depend on any of my (persistence) bind mounts otherwise it's too easy for local-fs to hang (/mnt/persist/private), or fail (/mnt/pool), and i lose critical things like *networking* this was only working because on servo the /mnt/persist/private deps caused a cycle and systemd just _removed_ local-fs.target --- modules/fs/default.nix | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/fs/default.nix b/modules/fs/default.nix index 3806be1ab..ce6900417 100644 --- a/modules/fs/default.nix +++ b/modules/fs/default.nix @@ -129,9 +129,7 @@ let }; # given a mountEntry definition, evaluate its toplevel `config` output. - mkMountConfig = path: opt: let - fsEntry = config.fileSystems."${path}"; - in { + mkMountConfig = path: opt: { # create the mount point, with desired acl systemd.tmpfiles.settings."00-10-sane-fs"."${path}".d = opt.acl; fileSystems."${path}" = { @@ -144,22 +142,27 @@ let # systemd-tmpfiles.service is one such example. # so, we *prefer* to be ordered before `local-fs.target` (since everything pulls that in), # but we generally don't want to *fail* `local-fs.target`, since that breaks everything, even `ssh` + # on the other hand, /mnt/persist/private can take an indeterminate amount of time to be mounted, + # and if they block local-fs, that might block things like networking as well... + # so don't even required `before=local-fs.target` # "noauto" "nofail" # x-systemd options documented here: # - - "x-systemd.before=local-fs.target" + # "x-systemd.before=local-fs.target" ]; noCheck = true; }; # specify `systemd.mounts` because otherwise systemd doesn't seem to pick up my `x-systemd` fs options? - systemd.mounts = [{ - where = path; - what = if fsEntry.device != null then fsEntry.device else ""; - type = fsEntry.fsType; - options = lib.concatStringsSep "," fsEntry.options; - before = [ "local-fs.target" ]; - }]; + # systemd.mounts = let + # fsEntry = config.fileSystems."${path}"; + # in [{ + # where = path; + # what = if fsEntry.device != null then fsEntry.device else ""; + # type = fsEntry.fsType; + # options = lib.concatStringsSep "," fsEntry.options; + # # before = [ "local-fs.target" ]; + # }]; }; mkDirConfig = path: opt: {