Bug 1010215 - inactive listed lightdm session prevent me from rebooting the system with a policy query
inactive listed lightdm session prevent me from rebooting the system with a p...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
20
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-20 05:14 EDT by Wolfgang Ulbrich
Modified: 2014-06-19 14:50 EDT (History)
14 users (show)

See Also:
Fixed In Version: systemd-208-2.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-19 14:50:18 EDT
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 Wolfgang Ulbrich 2013-09-20 05:14:18 EDT
Description of problem:
Inactive listed lightdm session prevent me from rebooting the system with a policy query.

        <action id="org.freedesktop.login1.reboot-multiple-sessions">
                <description>Reboot the system while other users are logged in</description>
                <message>Authentication is required for rebooting the system while other users are logged in.</message>
                <defaults>
                        <allow_any>auth_admin_keep</allow_any>
                        <allow_inactive>auth_admin_keep</allow_inactive>
                        <allow_active>auth_admin_keep</allow_active>
                </defaults>
                <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.reboot</annotate>
        </action>

This happend not with shutdown because is is allowed for active user!!!!

        <action id="org.freedesktop.login1.power-off-multiple-sessions">
                <description>Power off the system while other users are logged in</description>
                <message>Authentication is required for powering off the system while other users are logged in.</message>
                <defaults>
                        <allow_any>auth_admin_keep</allow_any>
                        <allow_inactive>auth_admin_keep</allow_inactive>
                        <allow_active>yes</allow_active>
                </defaults>
                <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.power-off</annotate>
        </action>

loginctl output after login:

[rave@mother ~]$ loginctl list-sessions
   SESSION        UID USER             SEAT            
        c1        995 lightdm          seat0           
         1       1000 rave             seat0           

2 sessions listed.

[rave@mother ~]$ loginctl show-session c1
Id=c1
Timestamp=Fr 2013-09-20 10:39:22 CEST
TimestampMonotonic=9335031
VTNr=1
Display=:0
Remote=no
Service=lightdm-greeter
Scope=session-c1.scope
Leader=1159
Audit=0
Type=x11
Class=user
Active=no
State=closing
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Name=lightdm

[rave@mother ~]$ loginctl show-session 1
Id=1
Timestamp=Fr 2013-09-20 10:39:30 CEST
TimestampMonotonic=17811896
VTNr=1
Display=:0
Remote=no
Service=lightdm
Scope=session-1.scope
Leader=1228
Audit=1
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Name=rave

Same output if i use gdm as display manager:

[rave@mother ~]$ loginctl list-sessions
   SESSION        UID USER             SEAT            
         1       1000 rave             seat0           

2 sessions listed.

[rave@mother ~]$ loginctl show-session 1
Id=1
Timestamp=Fr 2013-09-20 10:25:19 CEST
TimestampMonotonic=22371027
VTNr=1
Display=:0
Remote=no
Service=gdm-password
Scope=session-1.scope
Leader=1451
Audit=1
Type=x11
Class=user
Active=no
State=closing
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Name=rave

Here you see that no display manager session is listed and i can reboot the system without a policy query.
So i'm pretty shure that the inactive listed lightdm session cause the issue.
The policy query popup window happens outside from mate (different GTK theme).
Same still happens if i use cinnamon session.

Version-Release number of selected component (if applicable):
lightdm-1.7.15-1.fc20.x86_64
lightdm-gtk-1.6.1-1.fc20.x86_64

How reproducible:
everytime

Steps to Reproduce:
1.Login to mate-session
2.try reboot the system
3.policy query poped up outside from mate.

Actual results:
no reboot without entering the root password

Expected results:
reboot is allowed if no other user is logged in

Additional info:

I'm not shure if this is an blocker, but every user should be able to reboot the system if no other other user is loged in.
Comment 1 Rex Dieter 2013-09-21 11:29:00 EDT
so, inconsistent policy between restart and shutdown?  let's see what policykit folks have to say about that.
Comment 2 Wolfgang Ulbrich 2013-09-21 11:47:32 EDT
(In reply to Rex Dieter from comment #1)
> so, inconsistent policy between restart and shutdown?  let's see what
> policykit folks have to say about that.

Yes, but this isn't the real issue, this only explained why the issue doesn't exists for 'shutdown'.

Policykit should be recognize (inactive) lightdm session as an exception.
On the the otherside, why we have an existing lightdm session in f20?
Comment 3 Miloslav Trmač 2013-09-26 10:59:48 EDT
Both the maintenance of session list, and the determination whether to use org.freedesktop.login1.reboot or ...reboot-multiple-sessions , happens within systemd.
Comment 4 Lennart Poettering 2013-09-26 15:45:48 EDT
systemd/logind git will no longer consider sessions that are "closing" (i.e. where the user logged out but not all processes are dead yet) relevant for PolKit checks. That should fix the issue.

(I also brought the reboot/poweroff PK policies into sync).
Comment 5 Kirill Elagin 2013-09-27 10:17:02 EDT
In the first place, this closing session shouldn't be there.

I see it with lightdm-1.7.16:

~~~~~
kirrun@kirNote ~ [1034]% loginctl  
   SESSION        UID USER             SEAT            
         1       1000 kirrun           seat0           
        c6          0 root             seat0           
        c7       1000 kirrun           seat0           

3 sessions listed.
kirrun@kirNote ~ [1035]% loginctl session-status c6
c6 - root (0)
           Since: Fri 2013-09-27 17:32:43 MSK; 38min ago
          Leader: 5987
            Seat: seat0; vc7
         Display: :0
         Service: lightdm-greeter; type x11; class user
           State: closing
            Unit: session-c6.scope
                  |-5993 dbus-launch --autolaunch 77663d77fe2b88049d5e1d2800000024 --binary-syntax --close-stderr
                  `-5994 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
~~~~~

Is this a systemd or lightdm bug?
Comment 6 Fedora Update System 2013-10-02 08:12:33 EDT
systemd-208-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/systemd-208-1.fc20
Comment 7 Wolfgang Ulbrich 2013-10-02 11:21:23 EDT
This update fix the issue for me, thank you.
Comment 8 Fedora Update System 2013-10-02 21:10:15 EDT
Package systemd-208-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-208-2.fc20'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-18172/systemd-208-2.fc20
then log in and leave karma (feedback).
Comment 9 Fedora Update System 2013-10-03 22:01:08 EDT
systemd-208-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 leigh scott 2014-04-12 18:04:39 EDT
(In reply to Lennart Poettering from comment #4)
> systemd/logind git will no longer consider sessions that are "closing" (i.e.
> where the user logged out but not all processes are dead yet) relevant for
> PolKit checks. That should fix the issue.
> 
> (I also brought the reboot/poweroff PK policies into sync).

I'm getting a similar issue with the latest systemd

$ rpm -qa systemd\*
systemd-devel-208-15.fc20.x86_64
systemd-python3-208-15.fc20.x86_64
systemd-libs-208-15.fc20.x86_64
systemd-python-208-15.fc20.x86_64
systemd-208-15.fc20.x86_64
systemd-libs-208-15.fc20.i686


Using lightdm-gtk as a DM and logging out of a cinnamon/gnome-shell session doesn't close, this prevents user-switching  from working

$ loginctl
   SESSION        UID USER             SEAT            
         1       1000 leigh            seat0           
        c3        996 lightdm          seat0           
         3       1000 leigh            seat0           

3 sessions listed.


$ loginctl session-status 1
1 - leigh (1000)
           Since: Sat 2014-04-12 22:14:47 BST; 44min ago
          Leader: 1234
            Seat: seat0; vc1
         Display: :0
         Service: lightdm; type x11; class user
           State: closing
            Unit: session-1.scope
                  └─1463 /usr/bin/pulseaudio --start


killing the pulseaudio process closes the session " kill -9 1463"
Comment 11 Lennart Poettering 2014-06-19 14:50:18 EDT
leigh, that pa stays around for a while is totally normal, i see nothing to fix here.

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