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