You are not logged in.

#1 2013-10-05 17:52:38

rasoran
Member
Registered: 2013-03-25
Posts: 29

Systemd handle lid switch

as of yesterday, closing the lid no longer hibernates. When this initially occurred, I ran

systemctl hibernate

and found that it wasn't working either. So I reviewed the arch wiki and changed my /etc/mkinitcpio.conf, moving the "resume" parameter from the end in between block and filesystem.

/etc/mkinitcpio.conf

HOOKS="base udev autodetect modconf block resume filesystems keyboard fsck"

after rebuilding, I closed the lid and it worked.
However.
I don't recall if this began after a reboot but closing the lid did not work again. So I once again reviewed the process but could not find anything off. funnily enough this time

systemctl hibernate

works. Yet the lid does not. And for reference:

cat /etc/systemd/logind.conf

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=hibernate
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min

All of this happened yesterday. Any idea whats wrong or if there are any outputs I can provide?

Here is a list of all pacman action the past few days: http://pastebin.com/8JFzgXgL

Last edited by rasoran (2013-10-05 18:20:36)

Offline

#2 2013-10-05 22:15:23

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

Have you looked at the journal or logs for clues as to what stops hibernation?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-10-05 22:20:23

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

journalctl and dmesg dont seem to give anything regard lid/handle/hibernate.

Offline

#4 2013-10-05 22:26:46

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

Did you use sudo or su?

Last edited by cfr (2013-10-05 22:27:02)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-10-05 22:32:05

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

I just realized that too. I had to use sudo in order to run "systemctl hibernate" which i didn't have to do before. This is probably preventing closing the lid from hibernating as well. The only change in this regard is an update to systemd (within these past 2 days). Any ideas on fixes?

Offline

#6 2013-10-05 22:41:34

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

I actually meant: did you use sudo/su to get the journal output? By default, it'll only show you user logging otherwise.

Is polkit installed?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2013-10-05 22:46:27

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

polkit is installed. so I did a sudo journalctl -f and ran systemctl hibernate again and this is the new output.

Oct 05 15:45:13 arch dbus-daemon[341]: dbus[341]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.35"...
Oct 05 15:45:13 arch dbus[341]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.35" (uid=1000 pid=262...
Oct 05 15:45:13 arch polkitd[372]: Unregistered Authentication Agent for unix-process:2626:1899395 (system bus name :1.36, ob...rom bus)

and this is what I get when I close the lid

Oct 05 15:48:45 arch systemd-logind[338]: Lid closed.
Oct 05 15:48:45 arch systemd-logind[338]: Requested operation not supported, ignoring.
Oct 05 15:48:45 arch systemd-logind[338]: Requested operation not supported, ignoring.
Oct 05 15:48:45 arch systemd-logind[338]: Requested operation not supported, ignoring.
Oct 05 15:48:52 arch systemd-logind[338]: Lid opened.

ok I dug into the polkit entry in the wiki and i took a walk through /usr/share/polkit-1/actions/org.freedesktop.login1.policy which holds the permission on hibernation and

        <action id="org.freedesktop.login1.hibernate">
                <description>Hibernate the system</description>
                <message>Authentication is required for hibernating the system.</message>
                <defaults>
                        <allow_any>auth_admin_keep</allow_any>
                        <allow_inactive>auth_admin_keep</allow_inactive>
                        <allow_active>yes</allow_active>
                </defaults>
        </action>

so as an active use I should be able to without root access. so it seems like it views me as not an active user or as the wiki says "logged directly into the machine on a TTY or an X display"

Last edited by rasoran (2013-10-05 22:58:08)

Offline

#8 2013-10-05 23:03:17

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

What does

$ loginctl show-session $XDG_SESSION_ID

give?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2013-10-05 23:09:46

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

$ loginctl show-session $XDG_SESSION_ID

Id=1
Timestamp=Sat 2013-10-05 10:29:15 PDT
TimestampMonotonic=36062986
VTNr=2
Display=:0
Remote=no
Service=xdm
Scope=session-1.scope
Leader=383
Audit=1
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Name=nicholas

Does this https://wiki.archlinux.org/index.php/Systemd/User have something to do with it?

The systemd --user instance runs outside of any user session. This is ok for running, say mpd, but may be annoying if
one tries to start a window manager from the systemd user instance. Then polkit will prevent from mounting
usb's, rebooting, etc. as an unprivileged user, because the window manager is running outside of the
active session.

Last edited by rasoran (2013-10-05 23:14:45)

Offline

#10 2013-10-05 23:17:34

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

Yes but your X11 session appears to be running in the active session so I'm not sure that's the problem. Your output looks like mine except I'm using kdm rather than xdm.

Does loginctl show any other sessions?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2013-10-05 23:27:50

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

nope

$ loginctl list-sessions
 
  SESSION        UID USER             SEAT            
         1       1000 nicholas         seat0           

1 sessions listed.

Offline

#12 2013-10-05 23:56:14

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

Do other related commands work without sudo/su? Can you sleep or reboot, for example with just systemctl as an ordinary user?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#13 2013-10-06 00:17:45

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

systemctl reboot and suspend dont need root privilege.

Offline

#14 2013-10-06 00:37:56

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

OK. So it can't be a problem with your session stuff. That seemed so anyway but this seems to confirm it.

It can't be an issue with availability of swap etc. because it works with root privileges. (E.g. it can't be swap isn't active or whatever.)

So is there something else the system does when hibernating which might require privileges?

[Note: I don't have a clue at this point - I'm just trying to think the problem through.]


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2013-10-06 01:25:18

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

not sure if this is helpful but here is the entire journal entry for "sudo systemctl hibernate"

http://pastebin.com/F1Z1V9m9

Offline

#16 2013-10-06 02:10:57

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

That succeeds, though, right?
So can you post it for the non-privileged case where it fails? Maybe comparing the two would give some clue?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#17 2013-10-06 02:34:10

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

I did post that previously but it seems the forum is truncating text in the code tags. Here's the complete error message:

Oct 05 19:32:05 arch polkitd[367]: Registered Authentication Agent for unix-process:2889:824560 (system bus name :1.66 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)

Oct 05 19:32:05 arch dbus-daemon[348]: dbus[348]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.65" (uid=1000 pid=2889 comm="systemctl hibernate ") interface="org.freedesktop.systemd1.Manager" member="StartUnit" error name="(unset)" requested_reply="0" destination="org.freedesktop.systemd1" (uid=0 pid=1 comm="/sbin/init ")

Oct 05 19:32:05 arch dbus[348]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.65" (uid=1000 pid=2889 comm="systemctl hibernate ") interface="org.freedesktop.systemd1.Manager" member="StartUnit" error name="(unset)" requested_reply="0" destination="org.freedesktop.systemd1" (uid=0 pid=1 comm="/sbin/init ")

Oct 05 19:32:05 arch polkitd[367]: Unregistered Authentication Agent for unix-process:2889:824560 (system bus name :1.66, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)

Last edited by rasoran (2013-10-06 02:36:50)

Offline

#18 2013-10-06 02:58:16

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

But where does it get to? If you compare the journalctl output from the two cases, can you see what it gets stuck on when you don't have privileges?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#19 2013-10-07 23:47:16

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

If this can help at all here's a verbose version of the error output.

http://pastebin.com/u75epsc1

Offline

#20 2013-10-07 23:58:42

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd handle lid switch

So I guess http://cgit.freedesktop.org/systemd/sys … d-action.c is the source of the error?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#21 2013-10-08 00:45:43

rasoran
Member
Registered: 2013-03-25
Posts: 29

Re: Systemd handle lid switch

Well as a temporary fix I downgraded systemd back to 207-5 and its working properly again. Filing a bug report upstream.

Offline

Board footer

Powered by FluxBB