Red Hat Bugzilla – Bug 1476313
After `systemctl mask suspend.target`, attempting to suspend switches my graphical VT session to text mode
Last modified: 2017-09-13 11:47:13 EDT
Description of problem:
If I specifically run `systemctl mask suspend.target`, then attempting to suspend seems to switch my graphical VT session to text mode.
I don't mean it changes from VT2 to a different VT. I mean I'm on VT2, but after attempting to suspend VT2 does not show graphics any more. gdm is affected too. But my processes e.g. firefox are still running.
The weird thing is this doesn't happen if try suspending with `systemd-suspend.service` set to use `ExecStart=/bin/false` instead.
Version-Release number of selected component (if applicable):
How reproducible: always
Steps to Reproduce:
$ sudo systemctl mask suspend.target
$ sudo systemctl suspend
This switches me to a text VT. I can't get back to gdm - VT1 shows the textual boot messages. I can't get back to my desktop session, VT2 just shows `^@^@^@...` (like [here](https://unix.stackexchange.com/questions/360830/whats-nul-bombing-my-console-during-shutdown)). `w` still showed me logged in on `tty2`, and `ps` showed my firefox process was still running.
Suspend should fail, but I should see the graphical lock screen and be able to get back into my desktop session.
I tried reproducing this inside a VM.
In this case, the graphical screen remained (without a lock screen), but keyboard input was blocked (I think mouse blocked as well). Switching to a different VT and back showed a lock screen and un-blocked input.
This is a bug in logind, that it doesn't send a "resume" (PrepareToSleep false) signal in this case. I can say this with confidence because patching logind resolved the problem :). At least inside the VM. I'm sending a PR upstream which references this bug.
Note: kernel 4.12.5-300 fails to resume with QXL, generating a backtrace visible only if booted with `no_console_suspend`. Reverting to 4.11.11-300 got it working again.
https://github.com/systemd/systemd/pull/6666 has been merged.