"Shutdown" or "Restart" logs out

17,375

Solution 1

Sadly this is a known bug in (probably) consolekit LP #838792

The workaround for the time is

sudo reboot

sudo shutdown now -P

Solution 2

This should solve your problem: https://www.grendelman.net/wp/policykit-adventures/

Solution 3

Following these websites information: http://www.freedesktop.org/software/polkit/docs/0.105/pklocalauthority.8.html and https://bugs.launchpad.net/ubuntu/+source/policykit/+bug/1033305

Seems to have resolved our problems with the lightdm shutdown button not working for all users on Ubuntu 12.04.3 LTS (GNU/Linux 3.11.6-031106-generic x86_64)

vim /var/lib/polkit-1/localauthority/20-org.d/usershutdown.pkla

Then add the following lines to the file.

[Allow Shutdown]<br>
Identity=unix-user:\*;unix-group:*<br>
Action=org.freedesktop.consolekit.system.stop-multiple-users<br>
ResultAny=yes<br>
ResultInactive=yes<br>
ResultActive=yes<br>

[Allow Restart]<br>
Identity=unix-user:\*;unix-group:*<br>
Action=org.freedesktop.consolekit.system.restart-multiple-users<br>
ResultAny=yes<br>
ResultInactive=yes<br>
ResultActive=yes<br>

Then enter service lightdm restart and/or a reboot of the machine is needed. Tried before logging into the machine and then again after someone logged in.

Share:
17,375

Related videos on Youtube

jenls
Author by

jenls

Updated on September 18, 2022

Comments

  • jenls
    jenls over 1 year

    While logged in as a sudo user, click the right top power icon, then select and click Shutdown menu, it comes up with a dialog asking if I want to close all programs. The dialog has two options: restart or shutdown. Choose either one logs me out. Syslog has the following line about restart:

    WARNING: Unable to restart system: Authorization is required

    This happened after I installed NTP and some OpenStack packages while working in a prototype project. My Ubuntu's software is up to date as of this writing.

    Anyone encountered the same problem in 12.04?

    • Manish Sinha
      Manish Sinha about 12 years
      What is logged in as sudo user?
    • jenls
      jenls about 12 years
      "While logged in as a sudo user" I mean the default user created by Ubuntu installation. This user can run commands like "sudo ....".
    • Hosam.Yousof
      Hosam.Yousof about 12 years
      Same problem here under 12.04 (Lenovo thinkpad x121e). Can only use command line to restart/shut down the computer. Side effect is that my wife considers me a geek now as I shut down my laptop like this.
    • Kaos
      Kaos over 10 years
      very bad bug, exists from 10.10 until now
  • Kaos
    Kaos over 10 years
    its not a little bug, its a big bug
  • Tim
    Tim over 9 years
    How do you disable this?