Bug 1468003 - Setting HandleHibernateKey=ignore in logind.conf does not prevent hibernation
Setting HandleHibernateKey=ignore in logind.conf does not prevent hibernation
Status: NEW
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-05 14:43 EDT by Volker Sobek
Modified: 2017-07-07 05:35 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Volker Sobek 2017-07-05 14:43:31 EDT
Description of problem:

Setting 

HandleHibernateKey=ignore

in the [Login] section of /etc/systemd/logind.conf does not prevent hibernation when (accidentally) hitting the suspend key (combination).

Version-Release number of selected component (if applicable):
systemd-233-4.fc26.x86_64

How reproducible:
Set HandleHibernateKey=ignore in logind.conf

Actual results:
Jul 05 20:02:21 fuchur systemd-logind[1181]: Hibernate key pressed.
Jul 05 20:02:22 fuchur /usr/libexec/gdm-wayland-session[1423]: gnome-session-binary[1464]: DEBUG(+): GsmSystemd: received logind signal: PrepareForSleep
Jul 05 20:02:22 fuchur /usr/libexec/gdm-wayland-session[1423]: gnome-session-binary[1464]: DEBUG(+): GsmSystemd: ignoring PrepareForSleep signal
Jul 05 20:02:22 fuchur NetworkManager[1273]: <info>  [1499277742.0855] manager: sleep requested (sleeping: no  enabled: yes)
J
...

Expected results:
Pressing the hibernate key should be ignored

Additional info:
I have one laptop where I need to press Fn+F12 to get the 'plain' F12, if I hit this combination on my other laptop because of muscle memory I end up being stuck in broken hibernation process which requires me to manually force a restart with Ctrl+Alt+Del.
Comment 1 Volker Sobek 2017-07-05 14:46:20 EDT
(In reply to Volker Sobek from comment #0)
> Description of problem:
> 
> Setting 
> 
> HandleHibernateKey=ignore
> 
> in the [Login] section of /etc/systemd/logind.conf does not prevent
> hibernation when (accidentally) hitting the suspend key (combination).
I meant to write 'hibernation key' not 'suspend key' of course.
Comment 2 Volker Sobek 2017-07-06 10:22:28 EDT
I forgot to mention I also masked the hibernate.target, but that also doesn't prevent hibernation:

# systemctl status hibernate.target
● hibernate.target
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)
Comment 3 Jan Synacek 2017-07-07 04:03:36 EDT
Do you use GNOME? If yes, GNOME settings are used before logind settings. Try tweaking power options in your desktop environment first.
Comment 4 Volker Sobek 2017-07-07 05:35:53 EDT
(In reply to Jan Synacek from comment #3)
Yes, I use the default GNOME desktop on fedora. The only thing relevant seems to be org.gnome.settings-daemon.plugins.power power-button-action 'suspend', I didn't find anything related to hibernation.

Besides, even systemd ignores masking the hibernate.target: 

# systemctl mask hibernate.target
# systemctl hibernate

starts hibernating the system (and gets stuck somewhere).

Note You need to log in before you can comment on or make changes to this bug.