Bug 1268677 - Clicking 'poweroff' and 'reboot' menu items result in a 'logout' (only in live systems with two users)
Clicking 'poweroff' and 'reboot' menu items result in a 'logout' (only in liv...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: cinnamon-session (Show other bugs)
23
Unspecified Linux
unspecified Severity low
: ---
: ---
Assigned To: leigh scott
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-04 12:01 EDT by Giulio 'juliuxpigface'
Modified: 2015-10-10 07:55 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-10 06:49:30 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 Giulio 'juliuxpigface' 2015-10-04 12:01:01 EDT
Description of problem:
If a live system has got two users, 'poweroff' and 'reboot' menu items don't work properly. The actual result is a logout.

I've encountered this on a liveusb (with overlay) on bare metal. I've also done some tests with a qemu-kvm guest: I can't reproduce this on an installed system.

The conclusion is... This bug only affects live systems with at least two configured users. I imagine this is not a big issue and won't affect lots of people: that's why I set "severity" to low.

Version-Release number of selected component:
cinnamon-session-2.6.3-2.fc23.i686

How reproducible:
Always (with a live system)

Steps to Reproduce:
1. Boot a live USB with Cinnamon.
2. Wait until the desktop has been fully loaded.
3. Add a brand new user (with "# useradd").
4. Logout from liveuser.
5. Login with one of the two users.
6. Reboot or poweroff from the Cinnamon menu.

Actual results:
Fedora goes back to lightdm.

Expected results:
The system should be powered off or rebooted.
Comment 1 Giulio 'juliuxpigface' 2015-10-08 14:36:44 EDT
I did a couple of tests.

This bug is reproducible with Mate too, so it's not specifically related to Cinnamon. And, since I've had success after replacing lightdm with gdm, I'm reassigning the report to lightdm (at least for now).
Comment 2 Rex Dieter 2015-10-08 15:21:03 EDT
neither cinnamon or mate call lightdm directly to logout (but rather calls systemd methods), so I highly doubt lightdm has anything to do with this.

For example, does calling by hand in cinnamon (or mate) work?


$ dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanReboot

should say (essentially): "yes"

and then to actually try it:

$ dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:true
Comment 3 Giulio 'juliuxpigface' 2015-10-08 15:49:06 EDT
(In reply to Rex Dieter from comment #2)

> For example, does calling by hand in cinnamon (or mate) work?
> 
> 
> $ dbus-send --print-reply --system --dest=org.freedesktop.login1
> /org/freedesktop/login1 org.freedesktop.login1.Manager.CanReboot
> 
> should say (essentially): "yes"
> 

Tested it. No it doesn't. On this specific case, the string 'challenge' is returned:

[liveuser@localhost ~]$ dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanReboot

method return time=1444333437.217012 sender=:1.2 -> destination=:1.683 serial=71 reply_serial=2
   string "challenge"

> and then to actually try it:
> 
> $ dbus-send --print-reply --system --dest=org.freedesktop.login1
> /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:true

It fails

[liveuser@localhost ~]$ dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:true

Error org.freedesktop.DBus.Error.InteractiveAuthorizationRequired: Interactive authentication required.
Comment 4 Rex Dieter 2015-10-09 08:00:34 EDT
OK, that confirms it is a cinnamon issue , it should either 
* only offer reboot if CanReboot returns yes
* properly handle the "challenge" case with extra UI

If mate behaves similar, it needs fixing too.
Comment 5 Rex Dieter 2015-10-09 12:50:18 EDT
From,
http://www.freedesktop.org/wiki/Software/systemd/logind/

If "yes" is returned the operation is supported and the user may execute the operation without further authentication. If "no" is returned the operation is available but the user is not allowed to execute the operation. If "challenge" is returned the operation is available, but only after authorization.

So, seems, for whatever reason, policykit is claiming the liveuser requires authorization

Now, I need to look up the specific difference between 
yes => "may execute the operation without further authentication"
vs.
challenge => "only after authorization."
Comment 6 Giulio 'juliuxpigface' 2015-10-09 12:52:39 EDT
I can confirm the same behavior with Mate.

Those inputs return "challenge" and "Error org.freedesktop.DBus.Error.InteractiveAuthorizationRequired: Interactive authentication required" with Mate too.
Comment 7 Wolfgang Ulbrich 2015-10-09 13:06:55 EDT
From mate livecd TC1:

[liveuser@localhost ~]$ dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanReboot
method return time=1444410052.289544 sender=:1.2 -> destination=:1.46 serial=48 reply_serial=2
   string "yes"
[liveuser@localhost ~]$

And 
dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:true

reboot the livecd.

I created a second account, switch to them via user switching i result both accounts are active.
Loginctl list-users shows me both users.

And i've no problem to shutdown/rebbot the livecd if both accounts a active.
Comment 8 Giulio 'juliuxpigface' 2015-10-09 13:27:52 EDT
(In reply to Wolfgang Ulbrich from comment #7)
> I created a second account, switch to them via user switching i result both
> accounts are active.
> Loginctl list-users shows me both users.
> 
> And i've no problem to shutdown/rebbot the livecd if both accounts a active.

Yep, same behavior here with Cinnamon.
Comment 9 Wolfgang Ulbrich 2015-10-09 13:41:45 EDT
(In reply to Giulio 'juliuxpigface' from comment #8)
> (In reply to Wolfgang Ulbrich from comment #7)
> > I created a second account, switch to them via user switching i result both
> > accounts are active.
> > Loginctl list-users shows me both users.
> > 
> > And i've no problem to shutdown/rebbot the livecd if both accounts a active.
> 
> Yep, same behavior here with Cinnamon.

And what is your issue if you can reboot/shutdown?
Comment 10 Wolfgang Ulbrich 2015-10-09 13:43:45 EDT
Or did you make a mistake if you wrote the header?
"Clicking 'poweroff' and 'reboot' menu items result in a 'logout' (only in live systems with two users)"
Comment 11 Giulio 'juliuxpigface' 2015-10-09 15:36:11 EDT
The steps you outlined with comment #7 aren't those which trigger the issue. I wrote comment #8 because I thought you were trying to debug.

To reproduce it, you should perform a complete "logout", not only "switch user".
> 
> Steps to Reproduce:
> 1. Boot a live USB with Cinnamon.
> 2. Wait until the desktop has been fully loaded.
> 3. Add a brand new user (with "# useradd").
> 4. Logout from liveuser.
> 5. Login with one of the two users.
> 6. Reboot or poweroff from the Cinnamon menu.
> 

In this specific case, when I poweroff or reboot, the system goes back to lightdm instead of performing the requested action. As I said, it's more like a corner case, but it exists.

Ok, the header might not be entirely clear but, given the amount of conditions, it's hard to write a comprehensive description with just one sentence. Feel free to edit it, if you can improve it.
Comment 12 Wolfgang Ulbrich 2015-10-09 16:07:17 EDT
Ok, now i can confirm the issue.
If only one account is active than a shutdown push me back to lightdm login.
But honestly why you want to use 2 accounts on a livecd system.
A livecd is for doing a overview of the desktop before installation, and not for everyday usage or having wifi without installing a system ;)
I see no reason why i should create a second account.

Btw. I don't see the issue on bare metal after installation of f23, which indicates that nothing is wrong with mate systemd-logind support.
I think the concept of fedora's livecds isn't made for your usage.
Comment 13 leigh scott 2015-10-10 06:49:30 EDT
I don't have the time to fix live media issues!
Comment 14 Rex Dieter 2015-10-10 07:55:16 EDT
I'd be curious if anyone could reproduce this on a non-live system, simplified steps:

Steps to Reproduce:
1. Boot/login
2. Add a brand new user (with "# useradd").
3. Logout, login as new user from step 2, see what this says:
$ dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanReboot

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