From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Patterson Date: Wed, 06 Oct 2004 16:26:13 +0000 Subject: Re: Problems using scsi_id with udevstart Message-Id: <1097079973.2299.48.camel@bluto.andrew> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-9zhr3rlOxPEL8uEndcXU" List-Id: References: <1097019226.2300.38.camel@bluto.andrew> In-Reply-To: <1097019226.2300.38.camel@bluto.andrew> To: linux-hotplug@vger.kernel.org --=-9zhr3rlOxPEL8uEndcXU Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2004-10-05 at 16:53 -0700, Patrick Mansfield wrote: > I don't know much about how udevstart operates. Anyway ... >=20 > On Tue, Oct 05, 2004 at 05:33:46PM -0600, Andrew Patterson wrote: > > Hi, > >=20 > > I added the following udev rule to make human-readable device file name= s > > for my SCSI disks: > >=20 > > BUS=3D"scsi", KERNEL=3D"sd*", PROGRAM=3D"scsi_id", NAME=3D"scsi_disks/%= c-%b", > > SYMLINK=3D"%k" >=20 > Interesting ... I was thinking of the opposite type of rule to match some > of the SUSE device naming, like: >=20 > BUS=3D"scsi", KERNEL=3D"sd*", PROGRAM=3D"scsi_id", NAME=3D"%k" SYMLINK=3D= "scsi_disks/%c-%b",=20 >=20 Yes, I think this is better as well. Better to have the real node as the kernel name and the symlinks to the human-readable stuff. > > When I run udevstart, I get the following errors in the logfile: > >=20 > > Oct 5 17:25:17 natasha udevstart: PROGRAM execution of 'scsi_id' faile= d > > Oct 5 17:25:17 natasha udevstart: creating device node '/dev/sdy2' > > Oct 5 17:25:17 natasha udevstart: PROGRAM execution of 'scsi_id' faile= d > > Oct 5 17:25:17 natasha udevstart: creating device node '/dev/sdz' > >=20 > > scsi_id is failing because no parameters are being passed to it, and I > > think DEVPATH is also not being set appropriately. Here is debug > > output: > >=20 > > get_sysfs_device: device 2:0:0:0 is registered with bus 'scsi' > > namedev_name_device: sysfs_device- > > >path=3D'/sys/devices/pci0000:20/0000:20:01.0/host2/2:0:0:0' > > namedev_name_device: sysfs_device->bus_id=3D'2:0:0:0' > > namedev_name_device: sysfs_device->bus=3D'scsi' > > wait_for_device_to_initialize: looking for file 'vendor' on bus 'scsi' > > namedev_name_device: class_dev->name =3D 'sda' > > namedev_name_device: udev->kernel_name =3D 'sda' > > namedev_name_device: kernel_number=3D'' > > namedev_name_device: process rule > > match_rule: check for BUS dev->bus=3D'scsi' sysfs_device->bus=3D'scsi' > > match_rule: BUS matches > > match_rule: check PROGRAM > > execute_program:=20 > >=20 > > execute_program: result len 256 too short > > execute_program: result is ' matching >=20 As Kay mentioned, I need the full path to scsi_id. When using the full path you get the following: match_rule: check for BUS dev->bus=3D'scsi' sysfs_device->bus=3D'scsi' match_rule: BUS matches match_rule: check for KERNEL dev->kernel=3D'sd*' class_dev->name=3D'sda' match_rule: KERNEL matches match_rule: check PROGRAM execute_program: path =3D /sbin/scsi_id execute_program: result is '' execute_program: exec program status 0x100 match_rule: PROGRAM returned nonzero match_rule: try parent sysfs device Note: here is the error you get when scsi_id is run without any parameters: # /sbin/scsi_id -s must be specified > The above indicates udev thinks the output of scsi_id is too long. >=20 > [elm3b79 udev-bk]$ grep NAME_SIZE *.[hc] udev.h | grep define > logging.h:#define LOGNAME_SIZE 42 > udev.h:#define NAME_SIZE 256 > udev.h:#define NAME_SIZE 256 >=20 > Greg or Kay, can you verify the above? Should we / can we increase > NAME_SIZE? >=20 > Andrew - what does running scsi_id from the command line return for the > device? Like this: > =09 > scsi_id -s /block/sdN >=20 # /sbin/scsi_id -s /block/sda 2000c50fffe33f611 I have -g set in /etc/scsi_id.conf Andrew > -- Patrick Mansfield >=20 --=20 Andrew Patterson =20 Hewlett-Packard --=-9zhr3rlOxPEL8uEndcXU Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBBZByloKXgdXvblSgRAklVAKDE5PuU8y66qH05nRgFMXDz5YgihgCgrxsV 74mPvdH/u6+ot5nrU5W5dOI= =6TxK -----END PGP SIGNATURE----- --=-9zhr3rlOxPEL8uEndcXU-- ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel