Common Assignment Keys

The following table describes commonly used assignment keys in rules.

Assignment Key Description

ENV{key}

Specifies a value for the device property key, such as GROUP="disk".

GROUP

Specifies the group for a device file, such as GROUP="disk".

IMPORT{type}

Specifies a set of variables for the device property, depending on type:

cmdline

Import a single property from the boot kernel command line. For simple flags, udev sets the value of the property to 1. For example, IMPORT{cmdline}="nodmraid".

db

Interpret the specified value as an index into the device database and import a single property, which must have already been set by an earlier event. For example, IMPORT{db}="DM_UDEV_LOW_PRIORITY_FLAG".

file

Interpret the specified value as the name of a text file and import its contents, which must be in environmental key format. For example, IMPORT{file}="keyfile".

parent

Interpret the specified value as a key-name filter and import the stored keys from the database entry for the parent device. For example IMPORT{parent}="ID_*".

program

Run the specified value as an external program and imports its result, which must be in environmental key format. For example IMPORT{program}="usb_id --export %p".

MODE

Specifies the permissions for a device file, such as MODE="0640".

NAME

Specifies the name of a device file, such as NAME="em1".

OPTIONS

Specifies rule and device options, such as OPTIONS+="ignore_remove", which means that the device file isn't removed if the device is removed.

OWNER

Specifies the owner for a device file, such as GROUP="root".

RUN

Specifies a command to be run after the device file has been created, such as RUN+="/usr/bin/eject $kernel", where $kernel is the kernel name of the device.

SYMLINK

Specifies the name of a symbolic link to a device file, such as SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}", where $env{} is substituted with the specified device property.

Other assignment keys include ATTR{key}, GOTO, LABEL, RUN, and WAIT_FOR.