Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

shutdown/restart from Gnome (pre- and post-login) w/o root

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
Kringel
Posts: 44
Joined: 2012-10-20 10:33

shutdown/restart from Gnome (pre- and post-login) w/o root

#1 Post by Kringel »

Update: with beta 3 of wheezy the following steps where no longer neccessary

I just installed wheezy and installed the default Gnome desktop environment that boots to the Gnome-Login-Screen. If you do that you are asked for the root password when using shutdown/restart on the login-screen. The same happens when you are logged in and use the "Power off.." option when klicking the menu at the top right in combination with the ALT-key.

I solved this problem the following way: Add a powerdev group (seems to be expected in debian but was not created by the Wheezy-installation), add the users to that group, allow grant policies to that group to allow shutdown/restart.

Here are the steps in detail:

Create the group powerdev:

Code: Select all

groupadd powerdev
Add users to the powerdev group:

Code: Select all

# do the following for each username that should be allowed to shut down and restart the system
adduser [i]yourAccountName[/i] powerdev

# The Gnome-Login-Manger runs as user "Debian-gdm"
adduser Debian-gdm powerdev
Allow users in the powerdev group to restart/shutdown:
Create a file /etc/polkit-1/localauthority/50-local.d/10-power.pkla with the following content:

Code: Select all

[Local restart]
Identity=unix-group:powerdev
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
ResultInactive=no
ResultActive=yes

[Local shutdown]
Identity=unix-group:powerdev
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
ResultInactive=no
ResultActive=yes

[Local restart - multiple]
Identity=unix-group:powerdev
Action=org.freedesktop.consolekit.system.restart-multiple-users
ResultAny=yes
ResultInactive=no
ResultActive=yes

[Local shutdown - multiple]
Identity=unix-group:powerdev
Action=org.freedesktop.consolekit.system.stop-multiple-users
ResultAny=yes
ResultInactive=no
ResultActive=yes
I took that content from here and just modified the groups name to powerdev. Use "man pklocalauthority" for an explanation what this file does.

After that steps the shutdown/restart functions should work without asking for the root password.

I hope this is helpful. It works and makes sense to me. But let me know if this insttructions are bad/incorrect!

Also i wonder why the powerdev group is not created by the Wheezy installation. I think all three steps should automatically happen when someone installs a fresh system with the default desktop.

friartek
Posts: 4
Joined: 2013-10-26 04:47

Re: shutdown/restart from Gnome (pre- and post-login) w/o ro

#2 Post by friartek »

Experienced much the same with Wheezy 7.2. Have been running for a couple of months with Xfce4 and lightdm. After bringing the system out of hibernation I notice that the Mixer was no longer available. Since I wasn´t using sound at the time I ignored it. When I went to put the system back into hibernation, this failed. Couldn´t figure out what was going on and since I had a kernel upgrade reboot pending, I rebooted the system using the ¨Log Out Dialog¨.

Upon logging in I still had the same issues. Browsing the web I found several articles including this one. After doing the two group commands and logging back in, the mixer started to work again. Hibernation is also working again. I did not create the file /etc/polkit-1/localauthority/50-local.d/10-power.pkla.

I had added several packages just prior to these issues popping up, but don't believe any would have caused this. I had also done 3 upgrades:
  • Upgraded the following packages:
    google-chrome-stable (30.0.1599.66-1) to 30.0.1599.114-1
    xserver-common (2:1.12.4-6) to 2:1.12.4-6+deb7u1
    xserver-xorg-core (2:1.12.4-6) to 2:1.12.4-6+deb7u1
I wonder if the xserver upgrades could have caused the problem?

In addition my weather app stopped working. It didn't start working after the above changes. That is another problem, but not for here.
Note: Sometime just prior to Jan 24, 2014 an upgrade to the xfce4-weather-plugin was released. This appears to have fixed my weather app issue.

If I can add any additional information that may help find out what caused this, let me know and I´ll supply whatever info I have.

Post Reply