[PLUG] Actions after a USB device is plugged in

Roderick A. Anderson raanders at acm.org
Wed Oct 15 16:35:47 UTC 2008


Carlos Konstanski wrote:
> On Wed, 15 Oct 2008, Roderick A. Anderson wrote:
> 
>> Date: Wed, 15 Oct 2008 09:30:52 -0700
>> From: Roderick A. Anderson <raanders at acm.org>
>> Reply-To: "General Linux/UNIX discussion and help;	civil and on-topic"
>>     <plug at lists.pdxlinux.org>
>> To: "General Linux/UNIX discussion and help;	civil and on-topic"
>>     <plug at lists.pdxlinux.org>
>> Subject: Re: [PLUG] Actions after a USB device is plugged in
>>
>> Tim wrote:
>>>> Is there a way to automagically run a script or command (ln -sf
>>>> /dev/ttyUSB0 /dev/ttyS3) after the USB-to-serial device is plugged in?
>>>>
>>>> I don't run Ubuntu and can't install it as my bench/test machine is
>>>> being used by my wife while I fix her system. 8-(
>>>>
>>>> Any help is appreciated.
>>> Most modern Linux distributions use a daemon called udev or something
>>> similar to automatically generate /dev devices at boot time and for
>>> hotplugging events (like USB devices being added/removed).  Your best
>>> bet will probably be to look into udev's configuration under /etc/udev
>>> and create a rule to set up that symlink when the specific device is
>>> detected in the system.
>> Tim,
>>
>> Thanks.  My concern was with how Ubuntu does this stuff verses CentOS
>> (my distribution of choice.) You know, if it was a sort-of, SystemV
>> verses Berkeley thing.  I can now work on it now knowing it is udev.
>>
>> Rich, Carlos.
>>
>> Thanks for the ideas.
>>
>>
>> Rod
> 
> A quick google for udev shows that udev rules can easily create
> symlinks.  I would scrap my approach in favor of a 100% udev approach.

I found the same when I first started looking around.  After a short 
side trip down "Old Hotplug Lane" I realized I needed to know if Ubuntu 
used udev.

Watch out now.  I'm going to be dangerous.


Rod
-- 
> 
> Carlos
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug




More information about the PLUG mailing list