PDA

View Full Version : [XFCE] Shutdown using HAL


queenorych
February 18th, 2009, 17:47
Has anyone gotten XFCE to shutdown using HAL on freebsd? I get an error indicating org.freedesktop.hal.power-management.reboot is returning no.

XFCE's suggests:
<policy group="power">
<allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
...
</policy>

which does nothing as it appears all users are allowed this interface by default now.

I've added my user to wheel, operator, powerdev, power groups nothing.

I finally gave up and added my user to /usr/local/etc/PolicyKit.conf like this:
<match user="JimZlogar">
<return result="yes"/>
</match>

Am I missing something here? Everything seems to indicate that by adding myself to a group probably wheel or operator, this should work? Thanks

SR_Ind
February 19th, 2009, 14:42
Has anyone gotten XFCE to shutdown using HAL on freebsd? I get an error indicating org.freedesktop.hal.power-management.reboot is returning no.

XFCE's suggests:
<policy group="power">
<allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
...
</policy>

which does nothing as it appears all users are allowed this interface by default now.

I've added my user to wheel, operator, powerdev, power groups nothing.

I finally gave up and added my user to /usr/local/etc/PolicyKit.conf like this:
<match user="JimZlogar">
<return result="yes"/>
</match>

Am I missing something here? Everything seems to indicate that by adding myself to a group probably wheel or operator, this should work? Thanks

What's happening?

Do you have the following lines in your rc.conf?
dbus_enable="YES"
hald_enable="YES"

Xfce should have the reboot and shutdown buttons enabled if you have the above lines.

Also, have a check whether hald is running or not.

queenorych
February 19th, 2009, 15:53
Thanks for the reply. Yes I have dbus and hald enabled and running. lshal works fine. The shutdown and restart buttons are enabled. When I click reboot I get an error indicating that org.freedesktop.hal.power-management.reboot is returning no.

It is my understanding that this is a policykit issue. I'm just not sure how to fix the permissions so org.freedesktop.hal.power-management.reboot will let me reboot.

Kot_Bajun
March 19th, 2009, 23:50
full version:
<?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>
add user to operator group:
/etc/group:
operator:*:5:root,JimZlogar

reboot

fender0107401
August 19th, 2009, 10:44
Hi all:

I found this in the "/usr/ports/x11-wm/xfce4/Makefile":

@${ECHO} "================================================== =============="
@${ECHO}
@${ECHO} "If you want to allow users to restart or shutdown the system,"
@${ECHO} "do not forget to add the following lines between the <config>"
@${ECHO} "tags in your PolicyKit.conf file."
@${ECHO} " ${PREFIX}/etc/PolicyKit/PolicyKit.conf
@${ECHO} ""
@${ECHO} "<match action=\"org.freedesktop.hal.power-management.shutdown\">"
@${ECHO} " <return result=\"yes\"/>"
@${ECHO} "</match>"
@${ECHO} ""
@${ECHO} "<match action=\"org.freedesktop.hal.power-management.reboot\">"
@${ECHO} " <return result=\"yes\"/>"
@${ECHO} "</match>"
@${ECHO}
@${ECHO} "Make also sure, hald_enable, dbus_enable"
@${ECHO} "is set to YES in your /etc/rc.conf"
@${ECHO}
@${ECHO} "================================================== =============="

Lengsel
February 25th, 2010, 21:18
I made the changes to /usr/local/etc/PolicyKit/PolicyKit.conf and when I click on Shutdown or on Reboot, they both take me back to XDM. I can not turn off the computer from the menu, only from Terminal

gnutz
May 31st, 2010, 10:44
The solution I found was a very slight variation to the above:

http://forums.freebsd.org/showpost.php?p=85415&postcount=14

gnutz
May 31st, 2010, 10:46
The solution I found was a very slight variation to the above:

http://forums.freebsd.org/showpost.php?p=85415&postcount=14

...actually, that was the same exact thing. Do you have HAL and DBUS enabled?

SirDice
May 31st, 2010, 10:49
For this to work you will have to start XFCE via GDM.

gnutz
June 1st, 2010, 20:08
For this to work you will have to start XFCE via GDM.

Nonsense. I'm using SLiM as my desktop manager, and shutdown/reboot still works even when I'm not using a desktop manager at all.