All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Kane <adamk@inguin.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: RUN
Date: Fri, 13 Jul 2007 00:10:17 +0000	[thread overview]
Message-ID: <4696C2E9.40309@inguin.com> (raw)
In-Reply-To: <4693ECED.9090209@inguin.com>



Kay Sievers wrote:
> On 7/11/07, Adam Kane <adamk@inguin.com> wrote:
>> Using  the ; separator will not work.  I tried adding eval, and still no
>> luck.
>>
>> Putting the commands in one script is not feasible as I do not want the
>> script to reside on the machine, instead on the thumb drive.  Does that
>> make sense?
>>
>> Adam
>>
>> Bauke Jan Douma wrote:
>> > Adam Kane wrote on 10-07-07 22:32:
>> >> Hi list,
>> >>
>> >> Is it possible to use more than one RUN+= statement in a udev line,
>> >> or execute more than one thing?  I am wanting to execute more than
>> >> one thing upon my usb key being plugged in.
>> >>
>> >> Here is what I have in udev.rules
>> >>
>> >> BUS="scsi", SYSFS{model}="USB2FlashStorage", SYMLINK="usbdrive",
>> >> RUN+="/bin/mount /dev/usbdrive"
>> >>
>> >> The RUN+ statement is mounting the drive to /media/usbdrive, as
>> >> specified in the /etc/fstab.  I would like to to also run "/bin/sh
>> >> /media/usbdrive/test.sh"
>> >>
>> >> I have tried the following with no success:
>> >>
>> >> BUS="scsi", SYSFS{model}="USB2FlashStorage", SYMLINK="usbdrive",
>> >> RUN+="/bin/mount /dev/usbdrive ; /bin/sh /media/usbdrive/test.sh"
>> >>
>> >>
>> >> BUS="scsi", SYSFS{model}="USB2FlashStorage", SYMLINK="usbdrive",
>> >> RUN+="/bin/mount /dev/usbdrive && /bin/sh /media/usbdrive/test.sh"
>> >>
>> >>
>> >> BUS="scsi", SYSFS{model}="USB2FlashStorage", SYMLINK="usbdrive",
>> >> RUN+="/bin/mount /dev/usbdrive", RUN+="/bin/sh 
>> /media/usbdrive/test.sh"
>> >
>> > Something like RUN+="eval bin/mount /dev/usbdrive";
>> > /media/usbdrive/test.sh"?
>> > Or put all commands in one script and run that:
>> > RUN+="mount_and_test.sh"
>
> Today you can have only one RUN key, it will change some day, but I
> never got to finish the smarter rule parsing which will allow any
> number of keys in a rule.
>
> You need to do:
>   RUN+="/bin/sh -c '/program1; /program2'"
> for now.
>
> Kay
Thank you Kay, this solution has proved viable.

Adam

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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

  parent reply	other threads:[~2007-07-13  0:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 20:32 RUN Adam Kane
2007-07-10 22:01 ` RUN Bauke Jan Douma
2007-07-10 22:08 ` RUN Adam Kane
2007-07-11  0:04 ` RUN Kay Sievers
2007-07-11  0:59 ` RUN Richard Michael
2007-07-11  1:08 ` RUN Kay Sievers
2007-07-11  2:11 ` RUN Bryan Kadzban
2007-07-11  8:36 ` RUN Scott James Remnant
2007-07-11 13:12 ` RUN Richard Michael
2007-07-13  0:10 ` Adam Kane [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-11-18 22:05 run iPod

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=4696C2E9.40309@inguin.com \
    --to=adamk@inguin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.