mirror of
https://github.com/oqyude/nixos.git
synced 2026-10-11 14:27:26 +03:00
fix(storage-guard): remove '!' from ConditionPathIsMountPoint
CRITICAL BUG FIX caught by live test v6 on sapphira.
The '!' prefix INVERTS the systemd test:
ConditionPathIsMountPoint=!/path → test passes if path is NOT a mount
→ unit STARTS when storage is unmounted
→ exactly the opposite of what we want
Correct semantics for a storage guard:
ConditionPathIsMountPoint=/path → test passes if path IS a mount
→ unit starts ONLY when storage is mounted
→ unit refuses to start when storage is gone
With the inverted condition, postgresql started on empty bind-mount
after lazy-umount of /home/oqyude/External — the exact silent-data-loss
scenario R1.2 is supposed to prevent.
This is the canonical 'bug the test caught' case. Live test v6 on
sapphira (2026-10-10) demonstrated: with '!' the guard does nothing,
without '!' the guard fires correctly.
Lesson: always run a live test of the guard, don't trust nix eval alone
for systemd Condition* semantics — they're evaluated by systemd at
runtime, and '!' inverts the test.
This commit is contained in:
@@ -179,6 +179,6 @@ in
|
||||
# serviceConfig = xlib.helpers.mkStorageGuard xlib // { ...other fields... };
|
||||
mkStorageGuard = xlib: {
|
||||
RequiresMountsFor = [ xlib.dirs.server-home ];
|
||||
ConditionPathIsMountPoint = [ "!${xlib.dirs.server-home}" ];
|
||||
ConditionPathIsMountPoint = [ xlib.dirs.server-home ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user