Xorg freezes after resume when there are fuse sshfs mounts

Hello all,

I’m facing Xorg freezes when the laptop resume from sleep (suspend to RAM) since on TW when there fuse sshfs mounts. So starting up yesterday to track down what could be the culprit:

**root@raiatea:~ #** systemctl status systemd-suspend.service
● systemd-suspend.service - Suspend
     Loaded: loaded (/usr/lib/systemd/system/systemd-suspend.service; static)
     Active: inactive (dead)
       Docs: man:systemd-suspend.service(8)

déc. 19 23:05:17 raiatea.local systemd[1]: **systemd-suspend.service: Main process exited, code=exited, status=1/FAILURE**
déc. 19 23:05:17 raiatea.local systemd[1]: **systemd-suspend.service: Failed with result 'exit-code'.**
déc. 19 23:05:17 raiatea.local systemd[1]: **Failed to start Suspend.**
déc. 20 01:25:26 raiatea.local systemd[1]: Starting Suspend...
déc. 20 01:25:26 raiatea.local systemd-sleep[16161]: INFO: Skip running /usr/lib/systemd/system-sleep/grub2.sleep for suspend
déc. 20 01:25:26 raiatea.local systemd-sleep[16157]: Suspending system...
déc. 20 05:26:48 raiatea.local systemd-sleep[16157]: System resumed.
déc. 20 05:26:48 raiatea.local systemd-sleep[16312]: INFO: Skip running /usr/lib/systemd/system-sleep/grub2.sleep for suspend
déc. 20 05:26:48 raiatea.local systemd[1]: systemd-suspend.service: Succeeded.
déc. 20 05:26:48 raiatea.local systemd[1]: Finished Suspend.
**root@raiatea:~ #**

Ok so systemd-suspend.service couldn’t execute, let’s check system’s log (output was too long to post inline so here’s the relevant events: https://susepaste.org/22069673)

It looks like fuse sshfs mounts is locking down systemd-suspend.service’s proper execution. These mounts are in /etc/fstab and are protected by a key’s passphrase, which i believe is the problem. Unmounting mounts settle the problem and resuming works as expected.
I’ll try later to make passwordless ssh keys and see if it’s indeed the problem, even if I don’t like having my ssh keys with no passphrase.

According to the log snippet,
The error isn’t related to a resume, it’s related to starting the suspend.
Your system tried to suspend a second time and was successful.
In fact, you system didn’t resume again until 4 hrs later.

In general, I’d expect that remote connections should be terminated before suspending a machine.
I don’t know if suspend is supposed to handle mounting remote filesystems automatically, it’s not something I’d expect so never explored.

TSU

Thanks for your reply tsu2.

You are indeed correct saying remote mounted filesystems should be unmounted prior to suspend. It was the case on previous systems I had on this laptop (Mac OS X then FreeBSD).

I’ve made passwordless ssh keys for these mounts and it apparently fixed freezes when resuming though I dislike having my ssh keys passwordless. I’ll check how to make a systemd unit file to unmount remote fs before suspending.

That’s an interesting solution.

  1. Create a Unit file that unmounts your mounts
  2. Modify the suspend Unit file with a “Requires” pointing to the Unit file you just created.

The exact syntax is in the MAN files.

TSU

Thanks. Before doing so, I still see intermittent freezes when resuming when the laptop suspends from several hours…