FS#28386 - [systemd] non root user fails to shutdown or reboot using systemd in KDE

Attached to Project: Arch Linux
Opened by Ike Devolder (BlackEagle) - Sunday, 12 February 2012, 19:18 GMT
Last edited by Andrea Scarpino (BaSh) - Wednesday, 04 April 2012, 11:12 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Ronald van Haren (pressh)
Andrea Scarpino (BaSh)
Dave Reisner (falconindy)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 21
Private No

Details

Description:

with the latest systemd installed: systemd 42 i can no longer reboot or shutdown from a loggedin kde session, when i do so im dropped back to kdm
downgrading systemd to 37-3 all is working fine again, i dont see special failures in the logfiles or with systemd 42 installed i dont see anything special with systemd-journalctl -a


Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Wednesday, 04 April 2012, 11:12 GMT
Reason for closing:  Fixed
Additional comments about closing:  systemd 44-3
Comment by Dave Reisner (falconindy) - Sunday, 12 February 2012, 20:24 GMT
Sounds like you aren't being authorized.

This commit seems relevant: http://cgit.freedesktop.org/systemd/systemd/commit/?id=89f134406af6

Feel like reverting it and testing?

Also, need the output from 'systemd-loginctl'
Comment by Ike Devolder (BlackEagle) - Sunday, 12 February 2012, 21:25 GMT
i'll do my best to get to it, if i'm not capable to test it i'll let you know tomorrow evening

then i'm unfortunately 2 or more days without internet
Comment by Ike Devolder (BlackEagle) - Monday, 13 February 2012, 09:27 GMT
tested with systemd lxdm and xfce with systemd 42 and no issues at all, everything keeps on working fine

i can try again with kde and patched systemd this evening, maybe kde is doing something weird
Comment by Andrea Scarpino (BaSh) - Monday, 13 February 2012, 09:49 GMT
Comment by Ike Devolder (BlackEagle) - Monday, 13 February 2012, 11:14 GMT
lxdm + kde systemd reboot; shutdown ok
systemd-loginctl:
SESSION UID USER SEAT

0 sessions listed.

lxdm + xfce systemd reboot; shutdown ok
systemd-loginctl:
SESSION UID USER SEAT

0 sessions listed.

kdm + kde systemd reboot; shutdown fail
systemd-loginctl:
SESSION UID USER SEAT
c1 1000 ike seat0

1 sessions listed.

kdm + xfce systemd reboot; shutdown ok
systemd-loginctl:
SESSION UID USER SEAT
c2 1000 ike seat0

1 sessions listed.

ok i found enough space on my virtual machine to install kde and narrowed a little bit down

kdm + kde is a fail
Comment by Eric Pignet (eric.pignet) - Saturday, 18 February 2012, 23:43 GMT
Same problem here, also with kdm as display manager and the upgrade to systemd 42-1 (subsequent upgrade to systemd 43-2 did not help).

systemd-loginctl:
SESSION UID USER SEAT
1 0 root seat0
c5 1000 eric seat0
Comment by Łukasz Fibinger (lucke) - Sunday, 19 February 2012, 18:16 GMT
Reverting the commit didn't help. Please note that a consolekit error pops up in the log when kdm appears (polkitd(authority=local)[326]: Unregistered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session1 (system bus name :1.28, object path /org/kde/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)) and that everything works properly when kdm is started manually, not through the .service file. (# /usr/bin/kdm -nodaemon tty7).
Comment by Eric Pignet (eric.pignet) - Sunday, 19 February 2012, 20:29 GMT
This consolekit log does not look like an error. When the session is opened I have:

polkitd(authority=local): Registered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session6 (system bus name :1.99 [/usr/lib/kde4/libexec/polkit-kde-authentication-agent-1], object path /org/kde/PolicyKit1/AuthenticationAgent, locale fr_FR.UTF-8)

and when the session is closed:

polkitd(authority=local): Unregistered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session6 (system bus name :1.99, object path /org/kde/PolicyKit1/AuthenticationAgent, locale fr_FR.UTF-8)

Shutdown and restart also work well when kdm is started manually, not through systemd.
Comment by Łukasz Fibinger (lucke) - Monday, 20 February 2012, 12:43 GMT
You're right, that's most probably a regular message. I took "unregistered" for an adjective, not a verb.

Disabling pam_systemd makes restart/shutdown work.
Comment by Ike Devolder (BlackEagle) - Monday, 20 February 2012, 15:57 GMT
thx for the workaround ("solution") Łukasz

remove pam_systemd from
/etc/pam.d/kde
/etc/pam.d/kde-np

did work fine

so is this then a packaging bug in kdebase-workspace ?

is sshd also affected ? i saw that /etc/pam.d/sshd also had a reference to pam_systemd
Comment by Dave Reisner (falconindy) - Monday, 20 February 2012, 15:58 GMT Comment by Dave Reisner (falconindy) - Monday, 20 February 2012, 16:08 GMT
Please post the output of 'systemctl status dbus.service' from a non-working session. You should expect to see polkitd running...
Comment by Andrea Scarpino (BaSh) - Monday, 20 February 2012, 16:10 GMT
$ systemctl status dbus.service
dbus.service - D-Bus System Message Bus
Loaded: loaded (/lib/systemd/system/dbus.service; static)
Active: active (running) since Mon, 20 Feb 2012 10:10:38 +0100; 6h ago
Process: 1528 ExecStartPre=/bin/rm -f /var/run/dbus.pid (code=exited, status=0/SUCCESS)
Process: 1524 ExecStartPre=/usr/bin/dbus-uuidgen --ensure (code=exited, status=0/SUCCESS)
Main PID: 1534 (dbus-daemon)
CGroup: name=systemd:/system/dbus.service
â 1534 /usr/bin/dbus-daemon --system --address=systemd: --nofork --systemd-activation
â 1667 /usr/lib/polkit-1/polkitd --no-debug
â 1683 /usr/sbin/modem-manager
â 1778 /usr/lib/upower/upowerd
â 1806 /usr/lib/udisks/udisks-daemon
â 1807 udisks-daemon: not polling any devices
â 4092 /usr/sbin/wpa_supplicant -u
Comment by Ike Devolder (BlackEagle) - Monday, 20 February 2012, 18:33 GMT
Following is with the modified /etc/pam.d/kde{,-np} files:

dbus.service - D-Bus System Message Bus
Loaded: loaded (/lib/systemd/system/dbus.service; static)
Active: active (running) since Mon, 20 Feb 2012 19:29:03 +0100; 1min 22s ago
Process: 322 ExecStartPre=/bin/rm -f /var/run/dbus.pid (code=exited, status=0/SUCCESS)
Process: 317 ExecStartPre=/usr/bin/dbus-uuidgen --ensure (code=exited, status=0/SUCCESS)
Main PID: 324 (dbus-daemon)
CGroup: name=systemd:/system/dbus.service
├ 324 /usr/bin/dbus-daemon --system --address=systemd: --nofork --systemd-activation
├ 331 /usr/lib/polkit-1/polkitd --no-debug
├ 338 /usr/sbin/wpa_supplicant -u
├ 479 /usr/bin/ntpd -g -p /run/ntpd.pid
├ 612 /usr/lib/upower/upowerd
├ 634 /usr/lib/udisks/udisks-daemon
└ 640 udisks-daemon: not polling any devices

Feb 20 19:29:40 BlackEagle dbus-daemon[324]: **** CHANGING /sys/devices/pci0000:00/0000:00:11.0/host0/target0:0:0/0:0:0:0/block/sda/sda4
Feb 20 19:29:40 BlackEagle dbus-daemon[324]: **** UPDATING /sys/devices/pci0000:00/0000:00:11.0/host0/target0:0:0/0:0:0:0/block/sda/sda4
Feb 20 19:29:40 BlackEagle dbus-daemon[324]: **** CHANGED /sys/devices/pci0000:00/0000:00:11.0/host0/target0:0:0/0:0:0:0/block/sda/sda4
Feb 20 19:29:40 BlackEagle dbus-daemon[324]: helper(pid 643): completed with exit code 0
Feb 20 19:29:40 BlackEagle dbus-daemon[324]: **** EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:11.0/host0/target0:0:0/0:0:0:0/block/sda
Feb 20 19:29:46 BlackEagle dbus-daemon[324]: dbus[324]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freede....service'
Feb 20 19:29:46 BlackEagle dbus[324]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service'
Feb 20 19:29:46 BlackEagle dbus-daemon[324]: dbus[324]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit ... details.
Feb 20 19:29:46 BlackEagle dbus[324]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesk...r details.
Feb 20 19:29:55 BlackEagle polkitd(authority=local)[331]: Registered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session1 (sys...E.UTF-8)
Comment by Dave Reisner (falconindy) - Monday, 20 February 2012, 18:45 GMT
None of this is really interesting... pointing more at something broken in KDM upstream (my setup using lxdm works fine).

From a broken _and_ working session, the exit codes/output of:

pkcheck --action-id org.freedesktop.login1.reboot -u --process $$
pkcheck --action-id org.freedesktop.consolekit.system.restart -u --process $$

Make sure this is done from a fresh terminal and not something like a leftover tmux/session session of a previous login.
Comment by Ike Devolder (BlackEagle) - Monday, 20 February 2012, 18:59 GMT
both simply return 0 (kdm + kde, with modified /etc/pam.d/kde{,-np} which results in working shutdown and reboot)
system is freshly started

should the output be different ?
Comment by Dave Reisner (falconindy) - Monday, 20 February 2012, 19:00 GMT
Yes... I'd expect that they return 0 when it works. The interesting case is when it _doesnt_ work.
Comment by Ike Devolder (BlackEagle) - Monday, 20 February 2012, 19:05 GMT
both return 0 ( just changed the /etc/pam.d/kde{,-np} back, cant reboot, cant shutdown)
Comment by Dave Reisner (falconindy) - Monday, 20 February 2012, 19:08 GMT
You'll need to figure out what it is that KDM/KDE is sending to dbus to try and reboot/shutdown, then. You can use dbus-monitor.
Comment by Ike Devolder (BlackEagle) - Monday, 20 February 2012, 19:31 GMT
dbus-monitor stops before kdm restarts

any suggestions what to look for, the only things i find in the dbus-monitor log is logout in both cases

when i find the time i'll look into this lateron, i have no more time now
Comment by Dave Reisner (falconindy) - Monday, 20 February 2012, 19:35 GMT
monitor the system bus from a console session as root.
Comment by Łukasz Fibinger (lucke) - Monday, 20 February 2012, 19:53 GMT
Attached is the log from dbus-monitor --system, starting with logging in via kdm and ending with (failed) restarting.
Comment by Ike Devolder (BlackEagle) - Friday, 24 February 2012, 16:19 GMT
is there a need for more logging ?
Comment by Dieter Rethmeyer (Dieter) - Tuesday, 06 March 2012, 21:34 GMT
any news on this bug?
Comment by Dave Reisner (falconindy) - Tuesday, 06 March 2012, 21:35 GMT
Feel free to lean on KDE upstream (bug report was linked earlier in this FS). There's no packaging bug to fix here.
Comment by Andrea Scarpino (BaSh) - Sunday, 01 April 2012, 22:53 GMT
  • Field changed: Summary ([KDE] non root user fails to shutdown or reboot using systemd → [systemd] non root user fails to shutdown or reboot using systemd in KDE)
Comment by Dave Reisner (falconindy) - Sunday, 01 April 2012, 23:18 GMT
And this is in testing...

Loading...