BSD 4_4 release
[unix-history] / usr / src / old / init / init.8
index 6866ef0..4957621 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)init.8      6.2 (Berkeley) %G%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.TH INIT 8 ""
-.UC 4
-.SH NAME
-init \- process control initialization
-.SH SYNOPSIS
-.B /etc/init
-.SH DESCRIPTION
-.I Init
-is invoked inside UNIX as the last step in the boot procedure.
-It normally then runs the automatic reboot sequence as described in
-.IR reboot (8),
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)init.8     6.4 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.Dt INIT 8
+.Os BSD 4
+.Sh NAME
+.Nm init
+.Nd process control initialization
+.Sh SYNOPSIS
+.Nm init
+.Sh DESCRIPTION
+The
+.Nm init
+program
+is the last stage of the boot process.
+It normally runs the automatic reboot sequence as described in
+.Xr reboot 8 ,
 and if this succeeds, begins multi-user operation.
 If the reboot fails, it commences single user operation by giving
 and if this succeeds, begins multi-user operation.
 If the reboot fails, it commences single user operation by giving
-the super-user a shell on the console.  It is possible to pass parameters
+the super-user a shell on the console.
+The
+.Nm init
+program
+may be passed parameters
 from the boot program to
 from the boot program to
-.I init
-so that single user operation is commenced immediately.
-When such single user operation is terminated by killing the single-user
-shell (i.e. by hitting ^D),
-.I init
-runs
-.I /etc/rc
-without the reboot parameter.
-This command file
-performs housekeeping operations
-such as removing temporary files,
-mounting file systems, and starting
-daemons.
-.PP
+prevent the system from going multi-user and to instead execute
+a single user shell with out starting the normal daemons.
+The system is then quiescent for maintenance work and may
+later be made it go multi-user by killing the
+the single-user shell (with ^D).
+This
+causes
+.Nm init
+to run the
+.Pa /etc/rc
+start up command file without the reboot parameter.
+.Pp
 In multi-user operation, 
 In multi-user operation, 
-.I init's
-role is to create a process for each
-terminal port on which a user may log in.
-To begin such operations, it reads the file
-.I /etc/ttys
+.Nm init
+maintains
+processes for the terminal ports found in the file
+.Xr ttys 5.
+.Nm Init
+reads this file, and executes the command found in the second field.
+This command is usually
+.Xr getty 8 ;
+.Xr getty
+opens and initializes the tty line
 and
 and
-executes a command for each terminal specified in the file.
-This command will usually be
-.IR /etc/getty .
-.I Getty
-opens and initializes the terminal line,
-reads the user's name and invokes
-.I login
-to log in the user and execute the Shell.
-.PP
-Ultimately the Shell will terminate
-because of an end-of-file either
-typed explicitly or generated as a result of hanging up.
-The main path of
-.IR init ,
-which has been waiting
-for such an event,
-wakes up and removes the appropriate entry from the
-file
-.IR utmp ,
-which records current users, and
-makes an entry in
-.IR /usr/adm/wtmp ,
-which maintains a history
-of logins and logouts.
+executes the
+.Xr login
+program.
 The
 The
-.I wtmp
-entry is made only if a user logged in successfully on the line.
-Then the appropriate terminal is reopened and
-.I getty
-is
-reinvoked.
-.PP
-.I Init
-catches the
-.I hangup
-signal (signal SIGHUP) and interprets it to mean that
-the file
-.I /etc/ttys
-should be read again.
-The Shell process on each line which used to be active
-in
-.I ttys
-but is no longer there is terminated;
-a new process is created for each added line;
-lines unchanged in the file are undisturbed.
-Thus it is possible to drop or add terminal lines without
-rebooting the system by changing the
-.I ttys
-file and sending a
-.I hangup
-signal to the
-.I init
-process: use `kill \-HUP 1.'
-.PP
-.I Init
+.Xr login
+program, when a valid user logs in,
+exectutes a shell for that user.  When this shell
+dies, either because the user logged out
+or an abnormal termination occured (a signal),
+the
+.Nm init
+program wakes up, deletes the user
+from the
+.Xr utmp 5
+file of current users and records the logout in the
+.Xr wtmp
+file.
+The cycle is
+then restarted by
+.Nm init
+excuting a new
+.Xr getty
+for the line.
+.Pp
+Lines may be added or deleted from the
+.Xr ttys
+file without a reboot by sending the signal
+.Dv SIGHUP
+to
+.Nm init
+with the command
+.Dq Li "kill -HUP 1"
+Upon receipt of this signal,
+.Nm init
+re-reads the
+.Xr ttys
+file.
+Engaged (in use) ports
+are not disturbed,
+and if an engaged port has been deleted from the
+file, it will only become inactive after the engaging process has
+terminated (the user has logged off).
+If a port is inactive (only a
+.Xr getty
+or terminated processes are attached to it)
+.Nm init
+elimiates these processes.
+For these ports and any new ports, for which a command is found
+in the
+.Xr ttys
+file,
+.Nm init
+executes a new
+.Xr getty .
+.Pp
+.Nm Init
 will terminate multi-user operations and resume single-user mode
 will terminate multi-user operations and resume single-user mode
-if sent a terminate (TERM) signal, i.e. ``kill \-TERM 1''.
+if sent a terminate
+.Pq Dv TERM
+signal, for example,
+.Dq Li "kill \-TERM 1" .
 If there are processes outstanding which are deadlocked (due to
 hardware or software failure),
 If there are processes outstanding which are deadlocked (due to
 hardware or software failure),
-.I init
+.Xr init
 will not wait for them all to die (which might take forever), but
 will time out after 30 seconds and print a warning message.
 will not wait for them all to die (which might take forever), but
 will time out after 30 seconds and print a warning message.
-.PP
-.I Init
+.Pp
+.Nm Init
 will cease creating new
 will cease creating new
-.IR getty 's
-and allow the system to slowly die away, if it is sent a terminal stop (TSTP)
-signal, i.e. ``kill \-TSTP 1''.  A later hangup will resume full
+.Xr getty Ns 's
+and allow the system to slowly die away, if it is sent a terminal stop
+.Pq Dv TSTP
+signal, i.e.
+.Dq Li "kill \-TSTP 1" .
+A later hangup will resume full
 multi-user operations, or a terminate will initiate a single user shell.
 This hook is used by
 multi-user operations, or a terminate will initiate a single user shell.
 This hook is used by
-.IR reboot (8)
+.Xr reboot 8
 and
 and
-.IR halt (8).
-.PP
-.I Init's
-role is so critical that if it dies, the system will reboot itself
+.Xr halt 8 .
+.Pp
+The role of
+.Nm init
+is so critical that if it dies, the system will reboot itself
 automatically.
 If, at bootstrap time, the
 automatically.
 If, at bootstrap time, the
-.I init
+.Xr init
 process cannot be located, the system will loop in user mode at location
 0x13.
 process cannot be located, the system will loop in user mode at location
 0x13.
-.SH DIAGNOSTICS
-\fB/etc/getty\fP \fIgettyargs\fP\fB failing, sleeping\fP.
+.Sh DIAGNOSTICS
+.Bl -diag
+.It "/usr/libexec/getty \\*(eMgettyargs\\*(fP failing, sleeping."
 A process being started to service a line is exiting quickly
 each time it is started.
 This is often caused by a ringing or noisy terminal line.
 A process being started to service a line is exiting quickly
 each time it is started.
 This is often caused by a ringing or noisy terminal line.
-.I Init will sleep for 30 seconds, then continue trying to start the process.
-.LP
-\fBWARNING: Something is hung (wont die); ps axl advised\fR.  A process
+.Em "Init will sleep for 30 seconds" ,
+.Em "then continue trying to start the process" .
+.Pp
+.It "WARNING: Something is hung (wont die); ps axl advised."
+A process
 is hung and could not be killed when the system was shutting down.
 This is usually caused by a process
 which is stuck in a device driver due to a persistent device error condition.
 is hung and could not be killed when the system was shutting down.
 This is usually caused by a process
 which is stuck in a device driver due to a persistent device error condition.
-.SH FILES
-/dev/console,
-/dev/tty*,
-/etc/utmp,
-/usr/adm/wtmp,
-/etc/ttys,
-/etc/rc
-.SH "SEE ALSO"
-login(1), kill(1), sh(1), ttys(5), crash(8V), getty(8), rc(8), reboot(8),
-halt(8), shutdown(8)
+.El
+.Sh FILES
+.Bl -tag -width /var/log/wtmp -compact
+.It Pa /dev/console
+System console device.
+.It Pa /dev/tty*
+Terminal ports found in
+.Xr ttys .
+.It Pa /var/run/utmp
+Record of Current users on the system.
+.It Pa /var/log/wtmp
+Record of all logins and logouts.
+.It Pa /etc/ttys
+The terminal initialization information file.
+.It Pa /etc/rc
+System startup commands.
+.El
+.Sh SEE ALSO
+.Xr login 1 ,
+.Xr kill 1 ,
+.Xr sh 1 ,
+.Xr ttys 5 ,
+.Xr crash 8 ,
+.Xr getty 8 ,
+.Xr rc 8 ,
+.Xr reboot 8 ,
+.Xr halt 8 ,
+.Xr shutdown 8
+.Sh HISTORY
+A
+.Nm
+command appeared in
+.At v6 .