on.1 -- manual page for on.c
cak
cak
Sat Oct 9 11:47:20 AEST 1982
.PU
.TH ON 1
.SH NAME
on \- enable logins on a tty line
.br
off \- disable logins on a tty line
.SH SYNOPSIS
.B on
[
.RB \- n
]
[
.I ttyname
]
.br
.B off
[
.RB \- n
]
[
.RB \- f
]
[
.I ttyname
]
.SH DESCRIPTION
.I On
and
.I off
are used to enable or disable logins on a particular tty line, respectively.
This is done by rewriting
.I /etc/ttys
and signalling
.I init
(process 1) to re-read it and set up the
lines appropriately.
The
.I ttyname
should be specified as it appears in
.IR /etc/ttys ,
.IR i.e. ,
the full pathname with the
.I /dev/
stripped off.
.PP
If someone is logged in when a line is
.IR off ed,
.I off
will modify
.IR /etc/ttys ,
but will not signal
.IR init ,
allowing the user to finish up,
and print a message to this effect.
The
.RB \- f
flag will force a logoff.
.PP
The
.RB \- n
flag will cause
.IR on / off
to modify
.IR /etc/ttys ,
but
not signal
.IR init .
.PP
Invoking
.I on
or
.I off
without arguments will cause
.I init
to be signalled, with no change to
.IR /etc/ttys .
.SH NOTES
.I Off
is really just a link to
.IR on ;
the different functions are determined by looking at
the last character of the name the program was invoked by.
.br
Since these programs manipulate
.I /etc/ttys
and
.IR init,
they must be run as
.B root
to do any good.
.SH FILES
/etc/ttys
to signify which lines have logins enabled
.br
/etc/utmp
to see if anyone is logged in on the specified line
.SH "EXIT CODES"
Negative on error; 0 if the operation was successful and no
one was logged onto the tty; 1 if someone was logged in.
.SH AUTHOR
Christopher A. Kent
More information about the Comp.sources.unix
mailing list