per-user udev rules subset

Stef Bon stef at bononline.nl
Wed Oct 14 01:39:42 PDT 2009


Hello Raph,

I'm sorry to say, but your email is too technical (complicated) for me.
I'll go through your answer checking what you mean:


gibboris at gmail.com wrote:
> Hi Stef,
> From what I uinderstand, udev is to low-level.
>   
Too low-level. For what??
> My 1st goal is to get all devices (known and unknown) automounted.
>   
Automounted, ok. With automounter then or....?
> Then, to let a user spawn any action for any block device event
> (added, removed, mounted, unmounted)
>   

Spawn any action?? Explain. I'm dutch , my english is ok, but I do not 
understand this.
> 1) I have set all the rules for my known hardware in the fstab
> so users have the right to mount it.
>   
What rules?? How do they look like? Fstab is a file where all the system 
related mountcommands are listed... not per user/session info.
> 2) Here the devkit-disks-trigger (attachment) plays the role of ivman,
> nothing root happens : each user can set a configuration file and launch
> devkit-disks-trigger dbus listener at session startup so devices can be
> automounted (and eg, a terminal spawn in the mountpoint).
>   
Can you explain ivman, I've heard of this, it's a sort of automounter, 
but explain please.
Futher which mountpoint? How does this work according to you. Can you 
make a drawing to give an overview?

> 3) Then for the unknown devices, I will use the udev rule (I saw somewhere in the
> /usr/share/udev) which create a mount point (the mount point dir name
> can be numbered or can be the label of the partition, ...).
> It system-wide but then the users can also be warned about a new device mounted
> by devkit-disks-trigger as in 2).
>
> In my case, I don't really mind about mountpoint path, I just want the ability
> for a user to go there quickly so I want to have the freedom to launch the terminal
> in the mountpoint, set a variable, create a symlink, do a rsync, ...
>
> I'm quite sure you may find it useful with a config like :
> [my_device]
> IdLabel=mypictures
> # choice 1 : it's configured in fstab to let a user mount it
> DeviceAdded=mount %device_file my stuff like I want
>   
No, if working with a dynamic construction, you do not have to write 
lines in fstab first. It must be possible
to put in an USB device in any computer without having to write anything 
to fstab!


> DeviceMountPaths=/mnt/pictures #or /home/user/media/mypictures
> DeviceMounted=mirage /mnt/pictures
>   
No,this way there is only one mountpath: my idea is that in the 
configuration is should be possible to use a per user mountpath

> # choice 2 : the mount part is done by root, or udev
> # so we only do stuff at post-mount time
> DeviceMounted=mirage %device_mount_paths
>   
What;s this mirage thing??

Please note that not everybody has the same skills as you when 
answering... make your emails a little bit
readable.

Thanks,

Stef Bon

BTW: my fuse module to create a virtual network- and device map in the 
user's homedirectory:

http://linux.bononline.nl/linux/fuse-workspace/

I use the automounter for Linux to mount network devices. I'm not so far 
that my construction also deals with USB devices, but again, to let this
work ok on a multi user system, per-user device-disk rules are necessary.
To explain the idea: with the fuse-module it's possible to bind/mirror 
any file/directory on your computer in a subdirectory of your homedirectory.
So it's possible to mirror an USB device mounted at /media/USBstick to 
for example $HOME/Workspace/Devices/USBstick.

For the system the device is mounted at /media/USBstick, but for the 
users the path where it's mirrored/binded should be exported
to the graphical environment, making for example Dolphin show this 
device and open in the directory $HOME/Workspace/Devices/USBstick.
So per-user rules!! (or per-session....)






More information about the devkit-devel mailing list