Shutdown using HAL

queenorych

New Member


Messages: 2

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:
Code:
<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:
Code:
    <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

Active Member

Reaction score: 17
Messages: 138

queenorych said:
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:
Code:
<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:
Code:
    <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?
Code:
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.
 
OP
Q

queenorych

New Member


Messages: 2

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

New Member

Reaction score: 5
Messages: 1

full version:
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>
add user to operator group:
Code:
/etc/group:
operator:*:5:root,JimZlogar

reboot
 

fender0107401

Well-Known Member

Reaction score: 14
Messages: 341

Hi all:

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

Code:
	@${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

Member


Messages: 25

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
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,898
Messages: 40,623

For this to work you will have to start XFCE via GDM.
 

gnutz

New Member


Messages: 10

SirDice said:
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.
 
Top