How to mount USB drive for a user who is not logged in? (HAL, ConsoleKit, DBUS)

Adalbert Prokop adalbert.prokop at gmx.de
Fri Jun 8 17:37:06 UTC 2007


Hello everybody!

I've got a challenge I want to meet which came together with F7.

I want to mount a particular USB drive as soon as it is plugged in - as a 
user who is NOT logged in. It has to be done as "user", because the user 
must be able to unmount it after he logged in. The system I've created 
worked perfectly with FC5 and FC6 but ceased working since F7.

I use a hal .fdi spec to call a script which mounts my USB drive. 
Additionaly I had to write a DBUS rule allowing this particular send 
messages without being logged in. All scripts are attached below.

F7 comes with a new component: ConsoleKit. It seems to me that hal with 
compiled-in ConsoleKit support does not allow anybody who is not logged 
in to mount anything. I only get messages like

** (gnome-mount:32736): WARNING **: Mount failed 
for /org/freedesktop/Hal/devices/volume_uuid_8658_2213
org.freedesktop.Hal.PermissionDenied : Permission denied: Not in active 
session

The workaround I found: I've rebuilt the hal package without ConsoleKit 
support.

Is there a way to convince hal WITH ConsoleKit support to cooperate and 
respect my wishes? ;) Or is it a bug?
Maybe you know a smarter way to do what I need?

-- 
Bye,
Adalbert
-------------- next part --------------
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- --> 

<deviceinfo version="0.2">

  <device>
    <match key="@info.parent:info.product" string="Cruzer Micro">
      <match key="volume.label" string="USBDISK">
        <append key="info.callouts.add" type="strlist">dongle-mount</append>
      </match>
    </match>
  </device>

</deviceinfo>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dongle-mount
Type: application/x-shellscript
Size: 273 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070608/593ea05f/attachment-0001.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070608/593ea05f/attachment-0001.htm>


More information about the fedora-list mailing list