linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Patterson <andrew.patterson@hp.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Problems using scsi_id with udevstart
Date: Wed, 06 Oct 2004 17:33:55 +0000	[thread overview]
Message-ID: <1097084035.2284.73.camel@bluto.andrew> (raw)
In-Reply-To: <1097019226.2300.38.camel@bluto.andrew>

[-- Attachment #1: Type: text/plain, Size: 3308 bytes --]

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,
> > > > 
> > > > I added the following udev rule to make human-readable device file names
> > > > for my SCSI disks:
> > > > 
> > > > BUS="scsi", KERNEL="sd*", PROGRAM="scsi_id", NAME="scsi_disks/%c-%b", SYMLINK="%k"
> > >                                      ^^^^^^^
> > > 
> > > You need an absolute path here to properly call the binary.
> > 
> > Correct, too much cut an pasting.  It still doesn't work even with the
> > correct path.  Here is the output using /sbin/scsi_id:
> > 
> > namedev_name_device: sysfs_device->bus='scsi'
> > wait_for_device_to_initialize: looking for file 'vendor' on bus 'scsi'
> > namedev_name_device: class_dev->name = 'sda'
> > namedev_name_device: udev->kernel_name = 'sda'
> > namedev_name_device: kernel_number=''
> > namedev_name_device: process rule
> > match_rule: check for BUS dev->bus='scsi' sysfs_device->bus='scsi'
> > match_rule: BUS matches
> > match_rule: check for KERNEL dev->kernel='sd*' class_dev->name='sda'
> > match_rule: KERNEL matches
> > match_rule: check PROGRAM
> > execute_program: path = /sbin/scsi_id
> > 
> > execute_program: result is ''
> > execute_program: exec program status 0x100
> > match_rule: PROGRAM returned nonzero
> > match_rule: try parent sysfs device
> 
> Where is the "path = /sbin/scsi_id" line coming from? Other lines are missing.
> Did you change anything in the code. It should look more like this:
> 

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 = %s\n", path);

        i = 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=true DEBUG=true

>   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
> 
> And please try to run scsi_id on the commandline if it works there.
> 

# /sbin/scsi_id 
-s must be specified

# /sbin/scsi_id -s /block/sda
2000c50fffe33f611

The -g option was added in /etc/scsi_id.cong

> Kay
> 

Andrew

-- 
Andrew Patterson                
Hewlett-Packard

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2004-10-06 17:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-05 23:33 Problems using scsi_id with udevstart Andrew Patterson
2004-10-05 23:53 ` Patrick Mansfield
2004-10-05 23:55 ` Kay Sievers
2004-10-06 16:20 ` Andrew Patterson
2004-10-06 16:26 ` Andrew Patterson
2004-10-06 16:44 ` Kay Sievers
2004-10-06 16:59 ` Patrick Mansfield
2004-10-06 17:33 ` Andrew Patterson [this message]
2004-10-06 18:07 ` Kay Sievers
2004-10-06 18:42 ` Andrew Patterson
2004-10-06 19:13 ` Kay Sievers
2004-10-06 21:22 ` Andrew Patterson
2004-10-06 21:39 ` Kay Sievers
2004-10-06 22:24 ` Greg KH
2004-10-06 22:28 ` Andrew Patterson
2004-10-06 23:08 ` Kay Sievers
2004-10-06 23:19 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1097084035.2284.73.camel@bluto.andrew \
    --to=andrew.patterson@hp.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).