linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* trying to add a rule for USB external CD - a newbie
@ 2006-03-26 16:17 Ian Brown
  2006-03-26 16:32 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ian Brown @ 2006-03-26 16:17 UTC (permalink / raw)
  To: linux-hotplug

Hello,
 I am trying to add a rule for USB external CD  for udev;
this device uses scsi emulation; it;s device file is /dev/sr0

so I went to /etc/udev/rules.d and edited 50-udev.rules:
I added in the end this line:
KERNEL="sr[0-9]*", BUS="scsi", PROGRAM="/etc/udev/scripts/mount-cdrom.sh"

where mount-cdrom.sh has 2 lines :
echo "in mount-cdrom" >> /etc/udev/mountcdrom.log
mount /dev/sr0 /mnt/extcd
I restared udev (by /sbin/start_udev).

I  disconented the USB cdrom and connected it again.

I see that the cdrom is not mounted; On the other hand I see that we do create
the mount_cdrom log file.

What am I doing wrong?
Any idea?

Regards,
IB


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: trying to add a rule for USB external CD - a newbie
  2006-03-26 16:17 trying to add a rule for USB external CD - a newbie Ian Brown
@ 2006-03-26 16:32 ` Kay Sievers
  2006-03-27  7:09 ` Ian Brown
  2006-03-27 11:32 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2006-03-26 16:32 UTC (permalink / raw)
  To: linux-hotplug

On Sun, Mar 26, 2006 at 06:17:01PM +0200, Ian Brown wrote:
> Hello,
>  I am trying to add a rule for USB external CD  for udev;
> this device uses scsi emulation; it;s device file is /dev/sr0
> 
> so I went to /etc/udev/rules.d and edited 50-udev.rules:
> I added in the end this line:
> KERNEL="sr[0-9]*", BUS="scsi", PROGRAM="/etc/udev/scripts/mount-cdrom.sh"
> 
> where mount-cdrom.sh has 2 lines :
> echo "in mount-cdrom" >> /etc/udev/mountcdrom.log
> mount /dev/sr0 /mnt/extcd
> I restared udev (by /sbin/start_udev).
> 
> I  disconented the USB cdrom and connected it again.
> 
> I see that the cdrom is not mounted; On the other hand I see that we do create
> the mount_cdrom log file.
> 
> What am I doing wrong?

Use RUN+=, at the time PROGRAM runs you don't have a device node.
And use "=" if you compare values.

Kay


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: trying to add a rule for USB external CD - a newbie
  2006-03-26 16:17 trying to add a rule for USB external CD - a newbie Ian Brown
  2006-03-26 16:32 ` Kay Sievers
@ 2006-03-27  7:09 ` Ian Brown
  2006-03-27 11:32 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Ian Brown @ 2006-03-27  7:09 UTC (permalink / raw)
  To: linux-hotplug

Hello,
Thanks!
I had changed that line to:
KERNEL="sr[0-9]*", BUS="scsi", RUN+="/etc/udev/scripts/mount-cdrom.sh"

I am pulling the USB CD-ROM plug and pushing it again, and I
am getting:

 udev[21873]: parse error /etc/udev/rules.d/50-udev.rules, line 122:0,
rule skipped

Any idea?

Regards,
IB

On 3/26/06, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Sun, Mar 26, 2006 at 06:17:01PM +0200, Ian Brown wrote:
> > Hello,
> >  I am trying to add a rule for USB external CD  for udev;
> > this device uses scsi emulation; it;s device file is /dev/sr0
> >
> > so I went to /etc/udev/rules.d and edited 50-udev.rules:
> > I added in the end this line:
> > KERNEL="sr[0-9]*", BUS="scsi", PROGRAM="/etc/udev/scripts/mount-cdrom.sh"
> >
> > where mount-cdrom.sh has 2 lines :
> > echo "in mount-cdrom" >> /etc/udev/mountcdrom.log
> > mount /dev/sr0 /mnt/extcd
> > I restared udev (by /sbin/start_udev).
> >
> > I  disconented the USB cdrom and connected it again.
> >
> > I see that the cdrom is not mounted; On the other hand I see that we do create
> > the mount_cdrom log file.
> >
> > What am I doing wrong?
>
> Use RUN+=, at the time PROGRAM runs you don't have a device node.
> And use "=" if you compare values.
>
> Kay
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: trying to add a rule for USB external CD - a newbie
  2006-03-26 16:17 trying to add a rule for USB external CD - a newbie Ian Brown
  2006-03-26 16:32 ` Kay Sievers
  2006-03-27  7:09 ` Ian Brown
@ 2006-03-27 11:32 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2006-03-27 11:32 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Mar 27, 2006 at 09:09:27AM +0200, Ian Brown wrote:
> Hello,
> Thanks!
> I had changed that line to:
> KERNEL="sr[0-9]*", BUS="scsi", RUN+="/etc/udev/scripts/mount-cdrom.sh"
> 
> I am pulling the USB CD-ROM plug and pushing it again, and I
> am getting:
> 
>  udev[21873]: parse error /etc/udev/rules.d/50-udev.rules, line 122:0,
> rule skipped

What version of udev is that?

Kay


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-27 11:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-26 16:17 trying to add a rule for USB external CD - a newbie Ian Brown
2006-03-26 16:32 ` Kay Sievers
2006-03-27  7:09 ` Ian Brown
2006-03-27 11:32 ` Kay Sievers

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).