xfce4.8 shutdown/restart not working.

My /usr/local/etc/PolicyKit/PolicyKit.conf

Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->

<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">

<!-- See the manual page PolicyKit.conf(5) for file format -->

<config version="0.1">
        <define_admin_auth group="operator" />
        <match action="org.freedesktop.hal.storage.mount-removable">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.storage.mount-fixed">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.storage.eject">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.storage.unmount-others">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.power-management.reboot">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.power-management.shutdown">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.power-management.hibernate">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.power-management.suspend">
                <return result="yes" />
        </match>
</config>

My /etc/group
Code:
wheel:*:0:root,ember
operator:*:5:root,ember

My /etc/rc.conf
Code:
polkitd_enable="YES"
hald_enable="YES"
dbus_enable="YES"
But Logout gives me only logout. Not Restart or shutdown. I forgot something?

Code:
[file][B]uname -a[/B][/file]
FreeBSD BSD|ZFS 9.0-RC3 FreeBSD 9.0-RC3 #1: Tue Dec 13 16:03:41 EET 2011     root@BSD|ZFS:/usr/obj/usr/src/sys/MYKERNEL  amd64
 
I changed it and now looks like this:
Code:
<config version="0.1">
        <define_admin_auth group="operator" />
        <match action="org.freedesktop.hal.storage.mount-removable">
                <match user="ember">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.storage.mount-fixed">
                <match user="ember">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.storage.eject">
                <match user="ember">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.storage.unmount-others">
                <match user="ember">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.power-management.reboot">
                <match user="ember">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.power-management.shutdown">
                <match user="ember">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.power-management.hibernate">
                <match user="ember">
                <return result="yes" />
        </match>
        <match action="org.freedesktop.hal.power-management.suspend">
                <match user="ember">
                <return result="yes" />
        </match>
</config>
Rebooted but didn't change nothing
 
How are you starting XFCE? If you use x11/slim or startx there won't be a PolicyKit session.

The way to solve it (in ~/.xinitrc) is to start xfce like so:
Code:
exec ck-launch-session dbus-launch startxfce4

You can verify this by executing
[cmd=]ck-list-sessions[/cmd] when XFCE is started.
 
To be able to shutdown or reboot your system, you'll have to add a .pkla file
in %%LOCALBASE%%/etc/polkit-1/localauthority/50-local.d directory. Which looks
like this (replace PUTYOURGROUPHERE by your group):
Code:
[Restart]
Identity=unix-group:PUTYOURGROUPHERE
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Shutdown]
Identity=unix-group:PUTYOURGROUPHERE
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
ResultInactive=yes
ResultActive=yes

But even as root:
Code:
[ember@BSD|ZFS ~]$ cd /usr/local/etc/polkit-1/
bash: cd: /usr/local/etc/polkit-1/: Permission denied

I am starting xfce4 with startx. Never used a DM.

Code:
exec ck-launch-session dbus-launch startxfce4
on ~/.xinitrc didn't work.
ck-list-sessions Output:
Code:
Session1:
	unix-user = '1001'
	realname = 'Ember'
	seat = 'Seat2'
	session-type = ''
	active = FALSE
	x11-display = ''
	x11-display-device = ''
	display-device = 'ttyv0'
	remote-host-name = ''
	is-local = FALSE
	on-since = '2011-12-14T19:04:35.054263Z'
	login-session-id = ''
 
sk8harddiefast said:
But even as root:
Code:
[ember@BSD|ZFS ~]$ cd /usr/local/etc/polkit-1/
bash: cd: /usr/local/etc/polkit-1/: Permission denied

Try again, it works for root here. Might need to create some of the intermediate directories.
 
Login as root (Not using sudo) I can access the path :)

Code:
more /usr/local/etc/polkit-1/localauthority/50-local.d/[B].pkla[/B]

Code:
[Restart]
Identity=unix-group:wheel
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Shutdown]
Identity=unix-group:wheel
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
ResultInactive=yes
ResultActive=yes

But no changes. I made something wrong?
 
Code:
more /etc/group 
# $FreeBSD: releng/9.0/etc/group 218046 2011-01-28 22:28:12Z pjd $
#
wheel:*:0:root,ember
operator:*:5:root,ember
Yep.
 
You don't have to be in the operator group for this to work. My account certainly isn't and reboot/shutdown works fine in XFCE.

Looking at the ck-list-sessions output ConsoleKit/PolicyKit has a proper session.

The name of the pkla file in /usr/local/etc/polkit-1/localauthority/50-local.d/ doesn't matter, mine's called reboot.pkla.

Try a different group instead of wheel. Try the ember group (the primary group of your account).

Code:
[Restart]
Identity=unix-group:dice
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Shutdown]
Identity=unix-group:dice
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
ResultInactive=yes
ResultActive=yes
Code:
dice@williscorto:~>id -a
uid=1001(dice) gid=1001(dice) groups=1001(dice),68(dialer)
 
Back
Top