From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Patterson Date: Wed, 06 Oct 2004 17:33:55 +0000 Subject: Re: Problems using scsi_id with udevstart Message-Id: <1097084035.2284.73.camel@bluto.andrew> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-kY7JiP7DBklyeKilHNIK" List-Id: References: <1097019226.2300.38.camel@bluto.andrew> In-Reply-To: <1097019226.2300.38.camel@bluto.andrew> To: linux-hotplug@vger.kernel.org --=-kY7JiP7DBklyeKilHNIK Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2004-10-06 at 18:44 +0200, Kay Sievers wrote: > On Wed, Oct 06, 2004 at 10:20:56AM -0600, Andrew Patterson wrote: > > On Wed, 2004-10-06 at 01:55 +0200, Kay Sievers wrote: > > > 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 = names > > > > for my SCSI disks: > > > >=20 > > > > BUS=3D"scsi", KERNEL=3D"sd*", PROGRAM=3D"scsi_id", NAME=3D"scsi_dis= ks/%c-%b", SYMLINK=3D"%k" > > > ^^^^^^^ > > >=20 > > > You need an absolute path here to properly call the binary. > >=20 > > Correct, too much cut an pasting. It still doesn't work even with the > > correct path. Here is the output using /sbin/scsi_id: > >=20 > > 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 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 > >=20 > > execute_program: result is '' > > execute_program: exec program status 0x100 > > match_rule: PROGRAM returned nonzero > > match_rule: try parent sysfs device >=20 > Where is the "path =3D /sbin/scsi_id" line coming from? Other lines are m= issing. > Did you change anything in the code. It should look more like this: >=20 Yep, added some debugging code. Here are the diff's: diff -Nur udev-032/namedev.c udev-032.new/namedev.c --- udev-032/namedev.c 2004-09-13 23:55:36.000000000 -0600 +++ udev-032.new/namedev.c 2004-10-05 17:09:08.000000000 -0600 @@ -423,6 +423,8 @@ char arg[PROGRAM_SIZE]; char *argv[sizeof(arg) / 2]; int i; + + dbg("path =3D %s\n", path); i =3D 0; if (strchr(path, ' ')) { diff -Nur udev-032/udev.c udev-032.new/udev.c --- udev-032/udev.c 2004-09-13 23:55:32.000000000 -0600 +++ udev-032.new/udev.c 2004-10-05 16:58:37.000000000 -0600 @@ -50,8 +50,10 @@ return; va_start(args, format); - vsyslog(level, format, args); +// vsyslog(level, format, args); + vprintf(format, args); va_end(args); + printf("\n"); } #endif Here is the compile line I used: $ make USE_LOG=3Dtrue DEBUG=3Dtrue > udev[25565]: match_rule: KERNEL matches > udev[25565]: match_rule: check PROGRAM > udev[25565]: execute_program: execute '/bin/false' with main argument > udev[25565]: execute_program: result is '' > udev[25565]: execute_program: exec program status 0x100 > udev[25565]: match_rule: PROGRAM returned nonzero > udev[25565]: match_rule: try parent sysfs device >=20 > And please try to run scsi_id on the commandline if it works there. >=20 # /sbin/scsi_id=20 -s must be specified # /sbin/scsi_id -s /block/sda 2000c50fffe33f611 The -g option was added in /etc/scsi_id.cong > Kay >=20 Andrew --=20 Andrew Patterson =20 Hewlett-Packard --=-kY7JiP7DBklyeKilHNIK 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) iD8DBQBBZCyDoKXgdXvblSgRAs0IAKDDgybOjSvr2yualcZDuinmjV/0bgCeJ7F7 n2ct0gRUT7RxS/N3fk1n8Qw= =E9E+ -----END PGP SIGNATURE----- --=-kY7JiP7DBklyeKilHNIK-- ------------------------------------------------------- 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