1 .\" $NetBSD: ttyaction.5,v 1.7 2001/09/11 01:01:58 wiz Exp $
3 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd ttyaction file format
39 file specifies site-specific commands to run
40 when a login session begins and ends. The
42 file contains a list of newline separated records, where
43 each record has the following three fields:
44 .Bl -tag -width username
46 Name of the tty line(s) on which this line should apply.
47 The name is relative to the
49 directory, similar to how such devices are named in the
53 Name of the action for which this line should apply.
54 The action names currently defined are "login", "getty",
55 "telnetd" and "rlogind"
56 which indicate which program is processing this file.
57 (Note that "login" begins a login session, while the other
58 three are run after a login session ends.)
60 What command to run if this record matches.
63 The first two fields are delimited with blanks or tabs,
64 and the command field is all text to the end of the line.
65 Either or both of first two fields may contain wildcard
66 match patterns as implemented by the
70 All command strings are executed by passing them to
72 running as "root," with an environment containing:
73 .Bd -literal -offset indent
80 These variables may be used directly in the shell command
81 part of the record for simple tasks such as changing the
82 ownership of related devices. For example:
83 .Bd -literal -offset indent
84 console * chown ${USER}:tty /dev/mouse
89 the mouse appropriately when the console owner changes.
91 Here are some more example records:
92 .Bd -literal -offset indent
93 tty0 login /somewhere/tty_setup ${TTY}
94 tty0 getty /somewhere/tty_clean ${TTY}
95 * * /somewhere/ttyfrob ${TTY} ${ACT}
103 file were inspired by the