Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#1
after a recent upgrade I had some trouble with a new debian feature called policy kit. this feature was preventing hal from allowing a normal user to mount a usb drive. with anti's help, we adjusted a file called /etc/PolicyKit/PolicyKit.conf to restore the missing functions. Later I ran into a issue with"ejecting" a usb mp3 player. suspecting policykit again, some googling resulted in a brute force fix for my removable storage issues.

I've since discovered that PolicyKit also interferes with the function of the exitantix.sh script (the logout/suspend/shutdown menu), and while reboot and shutdown options work (I suspect do to the way the sudoers file is set up), the hibernate and suspend functions did not. applying what I learned when dealing with the removable storage issue, I made another mod to PolicyKit.conf.

Below is my new PolicyKit.conf file, with all mods. there may be ways to fine tune it to make it more restrictive or secure, but it got my functionality back.

Code: Select all

<!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">
        <match action="org.freedesktop.hal.storage.*">
            <return result="yes"/>
        </match>
   
        <match action="org.freedesktop.hal.power-management.*">
            <return result="yes"/>
        </match>
    </config>
Maybe this will help someone out. (props to the Arch Linux guys for this)
Posts: 319
impuwat
Joined: 13 Sep 2007
#2
Thanks for taking the time to document this!
Posts: 609
dark-D
Joined: 02 Jun 2008
#3
thanks dolphin_oracle. i was wandering why suspend didn't work.
Posts: 316
DJiNN
Joined: 26 Oct 2007
#4
Nice work, and many thanks for the code.

I've been having all sorts of problems with USB drives (Both keys & hard drives) lately, so hopefully this will go someway towards putting things right again. __{{emoticon}}__

DJiNN
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#5
I'm happy to contribute!
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#6
I pounded my head on this one. Devices would mount automatically but not unmount. Reboot/shutdown as well as suspend/hibernate would also fail saying"no action/result"? I ended up editing the file so thta every action is specifically mentioned and now xfce works perfectly again.

If your going to edit this file be sure to run, as root:

Code: Select all

 polkit-config-file-validate
Here is my new PolicyKit.conf

Code: Select all

<?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">
        <match action="org.freedesktop.hal.storage.*">
        <return result="yes"/>
        </match>

    <match action="org.freedesktop.hal.storage.unmount-removable">
        <return result="yes"/>
        </match>

    <match action="org.freedesktop.hal.storage.mount-removable">
             <return result="yes"/>
        </match>
   
        <match action="org.freedesktop.hal.power-management.*">
            <return result="yes"/>
        </match>

    <match action="org.freedesktop.hal.power-management.shutdown">
            <return result="yes"/>
        </match>

    <match action="org.freedesktop.hal.power-management.reboot">
            <return result="yes"/>
        </match>

    <match action="org.freedesktop.hal.power-management.suspend">
            <return result="yes"/>
        </match>

    <match action="org.freedesktop.hal.power-management.hibernate">
            <return result="yes"/>
        </match>
    </config>