Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]Plasma 5.13 Cannot shutdown/restart from system menu
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
big
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2007
Posts: 87

PostPosted: Thu Jul 26, 2018 6:18 am    Post subject: [solved]Plasma 5.13 Cannot shutdown/restart from system menu Reply with quote

The menu items do exist in the system menu, however not working.
When click to shutdown or restart system, it would just logoff and bring me a SDDM login screen.
Environments:
Plasma 5.13.3
SDDM 0.18.0
elogind 238.1
dbus 1.12.8
upower 0.99.7


cannot find any clue from the log..
It happened after a system update, and I've downgraded the listed packages but i still cannot find out which package should be responsible for this.
Any help would be appreciated. Thx!

Code:
Jul 26 13:56:56 gentoo-desktop kernel: <38>[  505.354362] [1515]: New session c2 of user sddm.
Jul 26 13:57:00 gentoo-desktop pulseaudio[2020]: [pulseaudio] module.c: After module unload, module 'module-null-sink' was still loaded!
Jul 26 13:57:02 gentoo-desktop kernel: <38>[  511.015577] [1515]: New session 2 of user ray.
Jul 26 13:57:02 gentoo-desktop sddm-helper: pam_kwallet5: final socket path: /run/user/1000/kwallet5.socket

_________________
be big,no bug


Last edited by big on Fri Jul 27, 2018 2:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
djhyland
n00b
n00b


Joined: 26 Nov 2008
Posts: 67
Location: St. Paul MN

PostPosted: Fri Jul 27, 2018 1:38 am    Post subject: Reply with quote

This sounds like it could be an "improvement" of a Polkit policy that your update brought in. The same thing happened to me along the way with Mate, and I fixed it as follows:

Check to see if you have a /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy file. If you do, open it and you'll see a bunch of entries like this:

Code:

  <action id="org.freedesktop.consolekit.system.stop">
    <description>Stop the system</description>
    <message>System policy prevents stopping the system</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>


The relevant ones for your problem will have descriptions like "Stop the system" and "Restart the system" and the like. Check the values between the <allow_active> tags; if they're not "yes", try changing them to "yes" and see if that doesn't let you shut down your system again.

Of course, having a good understanding of Polkit and what the options mean is better than trying my advice blindly, but I don't think that making the change above is going to seriously endanger your system.
Back to top
View user's profile Send private message
big
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2007
Posts: 87

PostPosted: Fri Jul 27, 2018 7:12 am    Post subject: Reply with quote

djhyland wrote:
This sounds like it could be an "improvement" of a Polkit policy that your update brought in. The same thing happened to me along the way with Mate, and I fixed it as follows:

Check to see if you have a /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy file. If you do, open it and you'll see a bunch of entries like this:

Code:

  <action id="org.freedesktop.consolekit.system.stop">
    <description>Stop the system</description>
    <message>System policy prevents stopping the system</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>


The relevant ones for your problem will have descriptions like "Stop the system" and "Restart the system" and the like. Check the values between the <allow_active> tags; if they're not "yes", try changing them to "yes" and see if that doesn't let you shut down your system again.

Of course, having a good understanding of Polkit and what the options mean is better than trying my advice blindly, but I don't think that making the change above is going to seriously endanger your system.


I've switched to elogind since the compatible issues between SDDM and Consolekit, hence there is no file named org.freedesktop.consolekit.policy. Follow your suggestion, I found a file named org.freedesktop.login1.policy that should correspond to org.freedesktop.consolekit.policy on your box. It seems unnecessary to change the defaults.

Code:
  <action id="org.freedesktop.login1.inhibit-block-shutdown">
    <description>Allow applications to inhibit system shutdown</description>
    <message>Authentication is required for an application to inhibit system shutdown.</message>
    <defaults>
      <allow_any>no</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.inhibit-delay-shutdown org.freedesktop.login1.inhibit-block-sleep org.freedesktop.login1.inhibit-delay-sleep org.freedesktop.login1.inhibit-block-idle</annotate>
  </action>
  <action id="org.freedesktop.login1.inhibit-delay-shutdown">
    <description>Allow applications to delay system shutdown</description>
    <message>Authentication is required for an application to delay system shutdown.</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.inhibit-delay-sleep</annotate>
  </action>

_________________
be big,no bug
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 136

PostPosted: Fri Jul 27, 2018 7:48 am    Post subject: Reply with quote

Please, check your ~/.local/share/sddm/xorg-session.log for errors.

(In mine there is something like:
Code:
** (process:11167): CRITICAL **: polkit_agent_listener_register_with_options: assertion 'POLKIT_IS_SUBJECT (subject)' failed
"Cannot register authentication agent!"
Authentication agent result: false
Couldn't register listener!


I have similar situation but now I am short on time and cannot debug this.

IMHO this could be a bug on kde side (especially powerdevil, or ksmserver).

In my case, I cant change brightness level by Fn keys ( echo 100 > /sys/class/backlight/amdgpu_bl0/brightness works) and poweroff and reboot command are causing log of.

Creating new user just to check if something is broken on config side makes no difference, but could be helpful for you tough.
Back to top
View user's profile Send private message
big
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2007
Posts: 87

PostPosted: Fri Jul 27, 2018 2:17 pm    Post subject: Reply with quote

PrSo wrote:
Please, check your ~/.local/share/sddm/xorg-session.log for errors.

(In mine there is something like:
Code:
** (process:11167): CRITICAL **: polkit_agent_listener_register_with_options: assertion 'POLKIT_IS_SUBJECT (subject)' failed
"Cannot register authentication agent!"
Authentication agent result: false
Couldn't register listener!


I have similar situation but now I am short on time and cannot debug this.

IMHO this could be a bug on kde side (especially powerdevil, or ksmserver).

In my case, I cant change brightness level by Fn keys ( echo 100 > /sys/class/backlight/amdgpu_bl0/brightness works) and poweroff and reboot command are causing log of.

Creating new user just to check if something is broken on config side makes no difference, but could be helpful for you tough.


I found the same yielding in my xorg-session.log and I got an error when issuing pkexec

$pkexec
Code:
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/bin/zsh' as the super user
Authenticating as: root
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

This incident has been reported.

It seems polkit authorization is broken.
Then I found this issue in the github.

However, there is a workaround to solve my issue.
Touch a new polkit rule file named 40-loing1.rules under /etc/polkit-1/rules.d
Code:
polkit.addRule(function(action, subject) {
        if (action.id == "org.freedesktop.login1.power-off" ||                                                 
                action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||                           
                action.id == "org.freedesktop.login1.reboot" ||                                                 
                action.id == "org.freedesktop.login1.reboot-multiple-sessions")                                 
        {
                return polkit.Result.YES;
        }
});

_________________
be big,no bug
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 136

PostPosted: Wed Aug 08, 2018 3:21 pm    Post subject: Reply with quote

I was totally wrong, indeed this is a polkit issue.
Please see:
https://bugs.gentoo.org/show_bug.cgi?id=662338
and
https://bugs.gentoo.org/show_bug.cgi?id=660880

On my machine placing the patch in "/etc/portage/patches/sys-auth/polkit/" and recompile polkit was the way to resolve this problem.

Hope this helps.
Back to top
View user's profile Send private message
big
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2007
Posts: 87

PostPosted: Thu Aug 09, 2018 6:12 am    Post subject: Reply with quote

PrSo wrote:
I was totally wrong, indeed this is a polkit issue.
Please see:
https://bugs.gentoo.org/show_bug.cgi?id=662338
and
https://bugs.gentoo.org/show_bug.cgi?id=660880

On my machine placing the patch in "/etc/portage/patches/sys-auth/polkit/" and recompile polkit was the way to resolve this problem.

Hope this helps.


Thanks! Update to Polkit-0.115-r1 solved the issue (bug #660880)
_________________
be big,no bug
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum