Thank you Tinkster.
It is exactly as you said. Playing some evenings with udev I have got what I wanted. Posting this reply just in case it could help someone.
Solution for Slackware 12.2.
USB plug/unplug event is forwarded to udev. Udev does it's stuff and then forwards to hal. If udev didnot solve mounting, hal does that. Noone acts against fstab settings. But hal does its own magic if no fstab entry for device. I solved all usb drives mounting within udev and fstab.
Good udev howto:
http://reactivated.net/writing_udev_rules.html
udev rules location on Slackware:
custom user rules: /etc/udev/rules.d
distribution rules: /lib/udev/rules.d
Udev useful commands:
Code:
#getting udev variables about /dev/sdc1
udevadm info -a -p $(udevadm info -q path -n /dev/sdc1)
#watching udev events occured
udevadm monitor --environment
#testing udev rules on /dev/sdc1
udevadm test $(udevadm info -q path -n /dev/sdc1)
#And here comes my two rules
#I have set them number 78
#After 60 and before system rule 79, because I need fstab info import after device is added.
Code:
#Here my custom script provides symlink name
#I need multiple fstab entries,
#depending on how many usb devices are added and depending on device filesystem
ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk|partition", ENV{ID_BUS}=="usb", ENV{ID_FS_USAGE}=="filesystem", PROGRAM="/get/symlinkname/from/kernelname/and/fstype %k $env{ID_FS_TYPE}", SYMLINK+="%c", GROUP="usb", MODE="0770"
#Here custom script clears unused mounting points
ACTION=="remove", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk|partition", ENV{ID_BUS}=="usb", ENV{FSTAB_DIR}=="/media/*", RUN+="/delete/mounting/point $env{FSTAB_DIR}"
As result now group "usb" can mount/unmount usb drives instead of default group "plugdev". Also devices are mounted to places I want according to fstab. No conflicts with hal, both KDE and Gnome work fine.