Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ttyaction(5) [netbsd man page]

TTYACTION(5)						      BSD File Formats Manual						      TTYACTION(5)

NAME
ttyaction -- ttyaction file format DESCRIPTION
The ttyaction file specifies site-specific commands to run when a login session begins and ends. The ttyaction file contains a list of new- line separated records, where each record has the following three fields: ttyname Name of the tty line(s) on which this line should apply. The name is relative to the /dev directory, similar to how such devices are named in the /etc/ttys file. action Name of the action for which this line should apply. The action names currently defined are "login", "getty", "telnetd" and "rlogind" which indicate which program is processing this file. (Note that "login" begins a login session, while the other three are run after a login session ends.) command What command to run if this record matches. The first two fields are delimited with blanks or tabs, and the command field is all text to the end of the line. Either or both of first two fields may contain wildcard match patterns as implemented by the fnmatch() library function. All command strings are executed by passing them to /bin/sh -c running as "root," with an environment containing: TTY=ttyname ACT=action USER=username PATH=_PATH_STDPATH These variables may be used directly in the shell command part of the record for simple tasks such as changing the ownership of related devices. For example: console * chown ${USER}:tty /dev/mouse will chown the mouse appropriately when the console owner changes. EXAMPLES
Here are some more example records: tty0 login /somewhere/tty_setup ${TTY} tty0 getty /somewhere/tty_clean ${TTY} * * /somewhere/ttyfrob ${TTY} ${ACT} SEE ALSO
fnmatch(3), ttyaction(3) HISTORY
The ideas for the /etc/ttyaction file were inspired by the /etc/fbtab file under SunOS. BSD
August 24, 1996 BSD

Check Out this Related Man Page

logindevperm(4) 						   File Formats 						   logindevperm(4)

NAME
logindevperm, fbtab - login-based device permissions SYNOPSIS
/etc/logindevperm DESCRIPTION
The /etc/logindevperm file contains information that is used by login(1) and ttymon(1M) to change the owner, group, and permissions of devices upon logging into or out of a console device. By default, this file contains lines for the keyboard, mouse, audio, and frame buffer devices. The owner of the devices listed in /etc/logindevperm is set to the owner of the console by login(1). The group of the devices is set to the owner's group specified in /etc/passwd. The permissions are set as specified in /etc/logindevperm. Fields are separated by TAB and/or SPACE characters. Blank lines and comments can appear anywhere in the file; comments start with a hash- mark, ` # ', and continue to the end of the line. The first field specifies the name of a console device (for example, /dev/console). The second field specifies the permissions to which the devices in the device_list field (third field) will be set. These permissions must be expressed in octal format. For example, O774. A device_list is a colon-separated list of device names. Note that a device name must be a /dev link. A device entry that is a directory name and ends with "/*" specifies all entries in the directory (except "." and ".."). For example, "/dev/fbs/*" specifies all frame buffer devices. Once the devices are owned by the user, their permissions and ownership can be changed using chmod(1) and chown(1), as with any other user- owned file. Upon logout the owner and group of these devices will be reset by ttymon(1M) to owner root and root's group as specified in /etc/passwd (typically other). The permissions are set as specified in the /etc/logindevperm file. FILES
/etc/passwd File that contains user group information. SEE ALSO
chmod(1), chown(1), login(1), ttymon(1M), passwd(4) NOTES
/etc/logindevperm provides a superset of the functionality provided by /etc/fbtab in SunOS 4.x releases. SunOS 5.10 22 Oct 2003 logindevperm(4)
Man Page