modules/external-storage: don't umount if already unmounted

This commit is contained in:
Max Headroom 2024-06-06 00:41:32 +02:00
parent 1283d32691
commit 31e0a1fd83

View file

@ -144,11 +144,13 @@ in
"--compress" "none"
] ++ commonOptions);
ExecStop = lib.escapeShellArgs [
"${s3ql}/bin/umount.s3ql"
"--log" "none"
fs.mountpoint
];
ExecStop = pkgs.writeShellScript "umount-s3ql-filesystem" ''
if grep -qw '${fs.mountpoint}' /proc/self/mounts; then
${s3ql}/bin/umount.s3ql --log none '${fs.mountpoint}'
else
echo Filesystem already unmounted.
fi
'';
# fsck and unmounting might take a while
TimeoutStartSec = "6h";