*** empty log message ***
1 parent fdb5ec5 commit edc89fe2020091a903b48d94484defd1fcbe4f08
@tundra tundra authored on 31 Oct 2013
Showing 1 changed file
View
30
Deconstructing_Linux_udev_Rules.rst
``if`` statements in a programming language. Assignment key-value
statements take some sort of action * usually on the thing that was
previously matched*. But, you're not restricted to this. It's
entirely possible to write a rule that operates on something
completely unrelated to the matched condition. For instance,
you could write a rule that says, *reboot the computer everytime
my little brother plugs in his favorite thumbdrive*. This is,
however, considered very bad manners and may get you sent to
your room without dinner.
completely unrelated to the matched condition. For instance, you
could write a rule that says, *reboot the computer everytime my little
brother plugs in his favorite thumbdrive*. (This is, however,
considered very bad manners and may get you sent to your room without
dinner.)
 
 
Let's take each rule apart, one key-value pair at a time:
 
 
- ``KERNEL=="sd*"``
- ``KERNEL=="sd*"``
 
This matches any time the kernel emits a message with the string
``sd`` followed by anything. For example, the kernel
sending messages about ``sda``, ``sdb``, ``sdc`` and so on
would all match.
 
Why are we doing this?
 
- ``PROGRAM=="/sbin/scsi_id --whitelisted /dev/$name"``
- ``RESULT=="1ATA_VBOX_HARDDISK_VB5f712327-2bb4be0c"``
- ``SYMLINK+="my_fine-disk01"``
- ``OWNER:="3009", GROUP:="421", MODE:="0600,``
 
Document Revision Information
=============================
 
``$Id: Deconstructing_Linux_udev_Rules.rst,v 1.108 2013/10/31 23:28:34 tundra Exp $``
``$Id: Deconstructing_Linux_udev_Rules.rst,v 1.109 2013/11/01 00:08:30 tundra Exp $``
 
You can find the latest version of this document at:
 
http://www.tundraware.com/TechnicalNotes/Deconstructing-Linux-udev-Rules