diff --git a/bin/omarchy-hibernation-setup b/bin/omarchy-hibernation-setup index da4629df..a70ec2b1 100755 --- a/bin/omarchy-hibernation-setup +++ b/bin/omarchy-hibernation-setup @@ -66,6 +66,9 @@ echo "HOOKS+=(resume)" | sudo tee "$MKINITCPIO_CONF" >/dev/null # Ensure keyboard backlight doesn't prevent sleep sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/lib/systemd/system-sleep/ +# Ensure FUSE mounts don't prevent sleep +sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/unmount-fuse" /usr/lib/systemd/system-sleep/ + # Add resume= kernel parameters so the initramfs resume hook knows where to find the # hibernation image. Without these, resume happens late (after GPU drivers load) and fails. RESUME_DROP_IN="/etc/limine-entry-tool.d/resume.conf" diff --git a/default/systemd/system-sleep/unmount-fuse b/default/systemd/system-sleep/unmount-fuse new file mode 100755 index 00000000..6b8654e6 --- /dev/null +++ b/default/systemd/system-sleep/unmount-fuse @@ -0,0 +1,14 @@ +#!/bin/bash + +# Lazy-unmount all FUSE filesystems before suspend/hibernate to prevent the +# kernel's process freeze from timing out. FUSE daemons (like gvfsd-fuse from +# Nautilus) can block in uninterruptible sleep during freeze, causing suspend +# to silently fail. The FUSE daemons restart automatically on wake. + +if [[ $1 == "pre" ]]; then + while IFS=' ' read -r _ mountpoint _ fstype _; do + if [[ $fstype == fuse.* ]]; then + fusermount3 -uz "$mountpoint" 2>/dev/null || fusermount -uz "$mountpoint" 2>/dev/null || true + fi + done < /proc/mounts +fi diff --git a/migrations/1773012889.sh b/migrations/1773012889.sh new file mode 100644 index 00000000..ba96067c --- /dev/null +++ b/migrations/1773012889.sh @@ -0,0 +1,4 @@ +echo "Install system-sleep hook to unmount FUSE before suspend/hibernate" + +sudo mkdir -p /usr/lib/systemd/system-sleep +sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/unmount-fuse" /usr/lib/systemd/system-sleep/