TTYACTION(5)
πΈ NAME πΈ β TTYACTION(5), aka ttyaction(5) from the File Formats Manual
ttyaction β the ttyaction file format, bestie. That's the whole vibe. π
β¨ DESCRIPTION β¨
okay so the ttyaction file is literally the site-specific commands file: it says what commands to run when a login session begins and ends. It contains a list of newline-separated records, and every record has these three fields:
ttynameβ the name of the tty line(s) this line should apply to. The name is relative to the/devdirectory, similar to how such devices are named in the/etc/ttysfile. πactionβ the name of the action this line should apply to. 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 the first two fields may contain wildcard match patterns as implemented by the fnmatch(3) library function. No cap. π¦
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. Periodt. πβ¨
π EXAMPLES π
Here are some more example records, bestie β copy the vibe, keep the exact fields:
tty0 login /somewhere/tty_setup ${TTY}
tty0 getty /somewhere/tty_clean ${TTY}
* * /somewhere/ttyfrob ${TTY} ${ACT}
π SEE ALSO π
fnmatch(3), ttyaction(3) β go read those too, iykyk. π
π¦ HISTORY π¦
Support for the /etc/ttyaction file first appeared in NetBSD 1.3. The ideas for the /etc/ttyaction file were inspired by the /etc/fbtab file under SunOS. That's the lore, and it's giving main character energy. π
okay that's the whole page, bestie β signing off from Debian, August 24, 1996. mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 1996 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms