BACKGROUND
I only use the scanner (UMAX Astra 1200S) occasionally and the scsi module aic7xxx takes around 20 seconds to auto detect on boot, so I do not load it on boot.
scsi scanners either have to be turned on at boot or detected with rescan-scsi-bus (root priveledges required).
I do not want other users to have the root password, so I used to use the following method.
The user would run the shell script "use_scanner" this calls a script "scanner" and then "xsane". The script "scanner" runs sudo and modprobes the scsi card then rescans the bus. xsane then runs as a normal user in the scanner group.
To enable this to work /dev/sg0 had to have been changed to owner root:scanner
PROBLEM
udev creates /dev/sg0 root:root automatically when the scsi bus is scanned. As it is not a persistent device I cannot chown it.
POTENTIAL WORK AROUNDS
---------------------------------------------
I have tried to create a udev rule in /etc/udev/rules.d/10-local.rules using udevinfo but to tell you the truth I don't relly understand udev yet.
Quote:
bash-3.1$ udevinfo -a -p /sys/class/scsi_generic/sg0
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/class/scsi_generic/sg0':
KERNEL=="sg0"
SUBSYSTEM=="scsi_generic"
DRIVER==""
SYSFS{dev}=="21:0"
looking at parent device '/devices/pci0000:00/0000:00:0c.0/host0/target0:0:6/0:0:6:0':
ID=="0:0:6:0"
BUS=="scsi"
DRIVER==""
SYSFS{ioerr_cnt}=="0x0"
SYSFS{iodone_cnt}=="0x6"
SYSFS{iorequest_cnt}=="0x6"
SYSFS{iocounterbits}=="32"
SYSFS{timeout}=="0"
SYSFS{state}=="running"
SYSFS{rev}=="V1.4"
SYSFS{model}=="Astra 1200S "
SYSFS{vendor}=="UMAX "
SYSFS{scsi_level}=="3"
SYSFS{type}=="6"
SYSFS{queue_type}=="none"
SYSFS{queue_depth}=="2"
SYSFS{device_blocked}=="0"
looking at parent device '/devices/pci0000:00/0000:00:0c.0/host0/target0:0:6':
ID=="target0:0:6"
BUS==""
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:0c.0/host0':
ID=="host0"
BUS==""
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:0c.0':
ID=="0000:00:0c.0"
BUS=="pci"
DRIVER=="aic7xxx"
SYSFS{modalias}=="pci:v00009004d00005078sv00009004sd00007850bc01sc00i00"
SYSFS{local_cpus}=="1"
SYSFS{irq}=="11"
SYSFS{class}=="0x010000"
SYSFS{subsystem_device}=="0x7850"
SYSFS{subsystem_vendor}=="0x9004"
SYSFS{device}=="0x5078"
SYSFS{vendor}=="0x9004"
looking at parent device '/devices/pci0000:00':
ID=="pci0000:00"
BUS==""
DRIVER==""
|
---------------------------------------------
There appear to be persistent devices in /lib/udev/devices that are copied to /dev when rc.udev is started. Is this the case, and if so would it be safe to create a new sg0 device here?
---------------------------------------------
What suggestions/fixes would you do?
Samac