DEVFSD(8)

NAME
devfsd - optional daemon for managing devfs (the Linux Device Filesystem)

SYNOPSIS
devfsd mntpnt [ -v ] [ -d ] [ -t num ] [ -D mask ] [ -fg ]

DESCRIPTION
The devfsd programme is a daemon, run by the system boot scripts which can provide for intelligent management of device entries in the Device Filesystem (devfs).

As part of its setup phase devfsd creates certain symbolic links which are compiled into the code. These links are required by /usr/src/linux/Documentation/devices.txt. This behaviour may change in future revisions.

devfsd will read the special control file .devfsd in a mounted devfs, listening for the creation and removal of device entries (this is termed a change operation). For each change operation, devfsd can take many actions. The daemon will normally run itself in the background and send messages to syslog.

The opening of the syslog service is automatically delayed until /dev/log is created.

At startup, before switching to daemon mode, devfsd will scan the mounted device tree and will generate synthetic REGISTER events for each leaf node.

OPTIONS

mntpnt
    This specifies a mount point for where devfs is mounted. This is typically "/dev".

-v  This option will print the protocol version numbers for devfsd and the kernel-side protocol version provided by devfs itself. The programme then exits.

-d  Run devfsd in debug mode. Used for debugging the kernel-side protocol implemented by devfs. This also prints the protocol version numbers. In this mode the daemon runs in the foreground.

-t num
    Set the trace level to num. If the level is greater than 0 then output is sent to stderr rather than syslog(3). If the level is greater than 1 then devfsd will run in trace mode. Higher levels yield more trace information.

-D mask
    Set the debug mask for devfs.

-fg Run the daemon in the foreground.

CONFIGURATION
The configuration file /etc/devfsd.conf configures the devfsd programme. It is a simple ASCII file with one configuration option per line. Comment lines must start with a leading '#' character. Comment lines and blank lines are ignored. Each configuration option is a keyword followed by zero or more parameters, depending on the option. The following section details the configuration options. Below are the permitted keywords:

INCLUDE path
    Include the configuration file named by path. Variable expansion is applied to path (see the section on VARIABLE EXPANSION below).

OPTIONAL_INCLUDE path
    As above, except that if the file does not exist, it is silently ignored.

CLEAR_CONFIG
    Clear the current configuration.

The config file can also be used to specify actions that should be taken at specified events. Each line specifies an event and action. The syntax is:

EVENT ACTION devname [args...]
    where EVENT is the event and ACTION is the action to take when the event occurs. The action is only taken when devname matches the name of the device entry affected (this does not include the mount point for the filesystem). This is processed as a regular expression. Some actions support extra arguments, passed as args. Variable expansion is applied to the arguments (see the section on VARIABLE EXPANSION below). In addition, the following variable names are recognised:

    devpath
        the full path name of the new device

    devname
        the name of the new device inside the devfs namespace

    mode
        the mode of the device entry in octal

    uid the user ID of the process or inode

    gid the group ID of the process or inode

The following events are recognised:

REGISTER
    The device entry was registered by a device driver.

UNREGISTER
    The device entry was unregistered by a device driver.

ASYNC_OPEN
    The inode was opened (the opening process does not wait for a response).

CLOSE
    The file was closed.

LOOKUP
    An inode lookup was performed and there was no device entry.

CHANGE
    Some inode attributes where changed.

CREATE
    An inode was created by a process.

The following actions are recognised:

PERMISSIONS devname owner_and_group access_mode
    owner_and_group specifies the owner and group that the file should be set to. This must be of the form "user.group" and either "user" or "group" component may be symbolic or numeric. access_mode specifies the access mode the file should be set to. This must be either an octal value or a symbolic string of nine characters with the form "rwxrwxrwx". Where access is not given, a '-' character should be used in place (e.g. "rw-rw-r--" gives read and write access to the user and group and only read access to everybody else).

EXECUTE devname path [arg...]
    This option allows you to run a programme when a device node is created. path is the pathname of the programme to run and arg is a set of optional arguments passed to the programme (maximum 6). path is the first argument (i.e. argv[0]) passed to the programme.

IGNORE devname
    This option causes all subsequent processing for the device to be ignored.

VARIABLE EXPANSION
A subset of normal Bourne shell variable expansion is applied to various expressions. The currently supported subset is: $variable, ${variable} and ${variable:-word}. Variables are taken from the environment. The following variable names are also defined :

hostname
    The hostname of the machine

mntpnt
    The mount point for devfs

SIGNALS
devfsd responds to signals in a variety of ways:

SIGINT
    devfsd will exit cleanly.

SIGTERM
    devfsd will exit cleanly.

SIGHUP
    The configuration file is re-read.

FILES
/etc/devfsd.conf
    the configuration file. If this file is missing or has zero size, devfsd will exit after its setup phase.

SEE ALSO
init(8),

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABILITY
The Device Filesystem daemon is available from: http://www.atnf.csiro.au/~rgooch/linux/