How do I monitor a usb donkey was plugged in? - Slackware

This is a discussion on How do I monitor a usb donkey was plugged in? - Slackware ; Hi, I want to write a program (a shell script maybe) to do something whenever a usb donkey is plugged into the slot. There is a vfat filesystem and some files on the usb. Would you please tell me how ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: How do I monitor a usb donkey was plugged in?

  1. How do I monitor a usb donkey was plugged in?

    Hi,

    I want to write a program (a shell script maybe) to do something
    whenever a usb donkey is plugged into the slot. There is a vfat
    filesystem and some files on the usb. Would you please tell me how
    to? Thanks.

  2. Re: How do I monitor a usb donkey was plugged in?

    Hi,
    I had the same question myself and solved by installing ivman. I start
    ivman from wm's initialization scripts and I configured it to run my
    usb scripts whenever a block device appears in my system as /dev/sdc.
    Probably you can make it more general.
    HTH

  3. Re: How do I monitor a usb donkey was plugged in?

    On Aug 5, 6:54 pm, iulian.t...@gmail.com wrote:
    > Hi,
    > I had the same question myself and solved by installing ivman. I start
    > ivman from wm's initialization scripts and I configured it to run my
    > usb scripts whenever a block device appears in my system as /dev/sdc.
    > Probably you can make it more general.
    > HTH


    Thank you! I will check out ivman. Hope it is a console program since
    the box does not have X.

  4. Re: How do I monitor a usb donkey was plugged in?

    On 2008-08-06, Steven Woody wrote:
    > On Aug 5, 6:54 pm, iulian.t...@gmail.com wrote:
    >> Hi,
    >> I had the same question myself and solved by installing ivman. I start
    >> ivman from wm's initialization scripts and I configured it to run my
    >> usb scripts whenever a block device appears in my system as /dev/sdc.
    >> Probably you can make it more general.
    >> HTH

    >
    > Thank you! I will check out ivman. Hope it is a console program since
    > the box does not have X.


    Or you could look into udev. Besides creating symlinks for your devices
    it can execute programs and scripts.
    Your machine already comes with udev, so you don't need to install extra
    packages.

  5. Re: How do I monitor a usb donkey was plugged in?

    On Aug 7, 4:46 am, Blikje Ham wrote:
    > On 2008-08-06, Steven Woody wrote:
    >
    > > On Aug 5, 6:54 pm, iulian.t...@gmail.com wrote:
    > >> Hi,
    > >> I had the same question myself and solved by installing ivman. I start
    > >> ivman from wm's initialization scripts and I configured it to run my
    > >> usb scripts whenever a block device appears in my system as /dev/sdc.
    > >> Probably you can make it more general.
    > >> HTH

    >
    > > Thank you! I will check out ivman. Hope it is a console program since
    > > the box does not have X.

    >
    > Or you could look into udev. Besides creating symlinks for your devices
    > it can execute programs and scripts.
    > Your machine already comes with udev, so you don't need to install extra
    > packages.


    Yes, my slack already has udev. But I don't have experience on it.
    Will it create a /dev/sd[a-z] file when a usb donkey plug in? Thanks.

  6. Re: How do I monitor a usb donkey was plugged in?

    On 2008-08-07, Steven Woody wrote:
    > On Aug 7, 4:46 am, Blikje Ham wrote:
    >> On 2008-08-06, Steven Woody wrote:
    >>
    >> Or you could look into udev. Besides creating symlinks for your devices
    >> it can execute programs and scripts.
    >> Your machine already comes with udev, so you don't need to install extra
    >> packages.

    >
    > Yes, my slack already has udev. But I don't have experience on it.
    > Will it create a /dev/sd[a-z] file when a usb donkey plug in? Thanks.


    You can configure it to do a whole lot of stuff. Look into the man-page,
    and on the internet, is my advise. I'm no udev expert.
    You can configure udev to create a symlink (like /dev/sd[a-z]), run programs.

    From the manpage:
    >RUN
    > Add a program to the list of programs to be executed for a specific
    > device. This can only be used for very short running tasks. Running
    > an event process for a long period of time may block all further
    > events for this or a dependent device. Long running tasks need to
    > be immediately detached from the event process itself.


    Good luck!

  7. Re: How do I monitor a usb donkey was plugged in?

    On Wed, 6 Aug 2008 22:49:27 -0700 (PDT)
    Steven Woody wrote:
    > Yes, my slack already has udev. But I don't have experience on it.
    > Will it create a /dev/sd[a-z] file when a usb donkey plug in? Thanks.


    If by a "USB donkey" you mean a flash drive, then the standard udev
    rules which come with the udev package would normally recognise it and
    give it a device file of the form /dev/sd[a-z][0-9]. Are you sure that
    one doesn't already exist?

    If not, then writing your own rule for the device is relatively trivial
    - see http://reactivated.net/writing_udev_rules.html . I have rules,
    for example, for my ipod and my samsung mobile phone which set up a
    device symlink in /dev for them, so that I can listen to the ipod or
    establish an internet connection with my mobile. I have another rule
    for my USB wireless stick, which will automatically cause wicd to link
    with relevant networks in range when I plug it in.

    Chris

  8. Re: How do I monitor a usb donkey was plugged in?

    On Thu, 07 Aug 2008 10:15:23 +0100, Chris Vine wrote:

    >> Yes, my slack already has udev. But I don't have experience on it. Will
    >> it create a /dev/sd[a-z] file when a usb donkey plug in? Thanks.

    >
    > If by a "USB donkey" you mean a flash drive,


    Possibly. The usual search engines do not clarify the issue.

  9. Re: How do I monitor a usb donkey was plugged in?

    Mark Madsen wrote:
    > On Thu, 07 Aug 2008 10:15:23 +0100, Chris Vine wrote:
    >
    >>> Yes, my slack already has udev. But I don't have experience on it. Will
    >>> it create a /dev/sd[a-z] file when a usb donkey plug in? Thanks.

    >>
    >> If by a "USB donkey" you mean a flash drive,

    >
    > Possibly. The usual search engines do not clarify the issue.


    i suspect the OP meant 'dongle'. that's actually how i read the word until
    your message prompted me to look closer... ;-)


    --
    Joost Kremers joostkremers@yahoo.com
    Selbst in die Unterwelt dringt durch Spalten Licht
    EN:SiS(9)

  10. Re: How do I monitor a usb donkey was plugged in?

    On Thu, 07 Aug 2008 09:45:41 +0000, Joost Kremers wrote:

    > Mark Madsen wrote:
    >> On Thu, 07 Aug 2008 10:15:23 +0100, Chris Vine wrote:
    >>
    >>>> Yes, my slack already has udev. But I don't have experience on it.
    >>>> Will it create a /dev/sd[a-z] file when a usb donkey plug in?
    >>>> Thanks.
    >>>
    >>> If by a "USB donkey" you mean a flash drive,

    >>
    >> Possibly. The usual search engines do not clarify the issue.

    >
    > i suspect the OP meant 'dongle'. that's actually how i read the word
    > until your message prompted me to look closer... ;-)


    Well, if one mixes "dongle" and "key" one gets "donkey", and the image of
    a beast of burden carting huge baskets full of data reluctantly around is
    really quite evocative :-)

  11. Re: How do I monitor a usb donkey was plugged in?

    On Thu, 7 Aug 2008, Mark Madsen wrote:

    > On Thu, 07 Aug 2008 10:15:23 +0100, Chris Vine wrote:
    >
    >>> Yes, my slack already has udev. But I don't have experience on it. Will
    >>> it create a /dev/sd[a-z] file when a usb donkey plug in? Thanks.

    >>
    >> If by a "USB donkey" you mean a flash drive,

    >
    > Possibly. The usual search engines do not clarify the issue.
    >

    I sort of wondered if it was a mangling of "dongle". Of course the
    word's meaning gets mangled in the first place. "When I was a kid", not
    really, it meant a little bit of hardware to allow the use of software;
    if the dongle wasn't in place it wouldn't run, hence it helped to
    ensure only legit copies of the software were out there.

    But then I keep seeing people recently use the word for small
    things sticking off some connector on the back, so I guess a
    USB flash drive would fit that.

    Michael


+ Reply to Thread