Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Perform an action when network cable unplugged (and back in again): have udev call you
- Date: Wed, 13 Jun 2012 08:38:01 -0400
- From: jep200404@example.com
- Subject: Re: [tlug] Perform an action when network cable unplugged (and back in again): have udev call you
- References: <4FD7DDC0.9090701@dcook.org> <CAAcd6GqmkcHhkLJv=UFaMoHBBJVx5ekpFj0Hrg+C7vsq=jz1pQ@mail.gmail.com> <20120613120015.407df2fd5e958adcae773233@kinali.ch> <4FD88209.6050300@dcook.org>
On Wed, 13 Jun 2012 21:05:29 +0900, Darren Cook <darren@example.com> wrote: > Interesting idea... but how do I know if udev gets an event? Have udev call you. Browse the *.rules files /etc/udev/rules.d/ (at least that's where they are in Centos 5). The grammar for udev rules has changed much over the years. It can be difficult finding documentation that matches the version of udev that you're using. Be prepared to fumble about and futz with things to workaround bad or wrong version documentation. After you figure out the right conditions, your code can be executed with the RUN or PROGRAM things. Udev rules look something like the following. [jep@centos5 ~]$ cat /etc/udev/rules.d/60-net.rules ACTION=="add", SUBSYSTEM=="net", IMPORT{program}="/lib/udev/rename_device" SUBSYSTEM=="net", RUN+="/etc/sysconfig/network-scripts/net.hotplug" [jep@centos5 ~]$ or look at the PROGRAM stuff in the following: SUBSYSTEM=="tty", BUS=="usb", SYSFS{idProduct}=="1234", SYSFS{idVendor}=="5678", PROGRAM="/etc/udev/rules.d/persistent-tty-namer $SYSFS{serial} $SYSFS{bInterfaceNumber}", SYMLINK+="%c" There's much that can be done with udev.
- Follow-Ups:
- References:
- [tlug] Perform an action when network cable unplugged (and back in again)
- From: Darren Cook
- Re: [tlug] Perform an action when network cable unplugged (and back in again)
- From: Jawaad Mahmood
- Re: [tlug] Perform an action when network cable unplugged (and back in again)
- From: Attila Kinali
- Re: [tlug] Perform an action when network cable unplugged (and back in again)
- From: Darren Cook
Home | Main Index | Thread Index
- Prev by Date: [tlug] Why just two packages unauthenticated
- Next by Date: [tlug] Why just two packages unauthenticated
- Previous by thread: Re: [tlug] Perform an action when network cable unplugged (and back in again)
- Next by thread: Re: [tlug] Perform an action when network cable unplugged (and back in again): have udev call you
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links