Re: udev / hotplug question, actions on plug-in a usb device?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Schlueri wrote:
> Hi there, 
> 
> i have brought a hauppauge nova-t dvb-t usb stick. Working fine. After
> compiling the latest v4l-dvb, actually the remote control is working,
> too.
> 
> Now i want start lircd and irexec daemon on plug-in the usb stick and
> stop these daemons on plug-out. I think i can do this with udev?
> 
> Is there any way to fixing the input device? Seems like it changing from
> time to time. 
> 
> input: IR-receiver inside an USB DVB receiver as /class/input/input8
> 
> Or read the actual input device on usb plug-in to start lircd with the
> correct parameters? (i.e. -H dev/input -d /dev/input/event8")
> 
> I've searching around, but it would be fine, to get some help or
> directions.
> 
> Thanks
> Dirk
> 
Yes, udev can be set to do this. What you would want to do is create
a set of local rules for the device that create consistent symlinks
and then access the symlinks instead of the kernel names. You can
also have the rules launch a program. The rules for when you insert
the device should probably match idVendor and idProduct. (I think I
spelled them correctly.) The rules on removal get a bit more
complicated. At least when I was testing things, there is not an
idVendor and idProduct to match on when removing the device. I
solved that by setting a ENV value for the device.

Here is what I did for a USB GPS device.

KERNEL=="ttyUSB*", SUBSYSTEM=="tty", SYSFS{idVendor}=="0403",
SYSFS{idProduct}=="6001", ENV{GPS_DEV}="true",
RUN+="/etc/udev/scripts/gpsd.dev"

ACTION=="remove", KERNEL=="ttyUSB*", SUBSYSTEM=="tty",
ENV{GPS_DEV}=="true", RUN+="/etc/udev/scripts/gpsd.dev"

You can read the udev docs, and look at the existing rules for more
ideas. Let us know if you need mre help.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux