Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ init(8) — AOS 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

login(1)

kill(1)

sh(1)

ttys(5)

crash(8R)

getty(8)

rc(8)

reboot(8)

halt(8)

shutdown(8)

INIT(8)  —  

NAME

init − process control initialization

SYNOPSIS

/etc/init

DESCRIPTION

Init is invoked inside IBM/4.3 as the last step in the boot procedure.  It then normally runs the automatic reboot sequence as described in reboot(8) and, if this succeeds, begins multi-user operation. If the reboot fails, init commences single-user operation by giving the super-user a shell on the console.  It is possible to pass parameters from the boot program to init so that single-user operation commences immediately.  When single-user operation is terminated by killing the single-user shell (i.e. by hitting ^D), init runs /etc/rc without the reboot parameter.  This command file performs housekeeping operations such as removing temporary files, mounting file systems and starting daemons. 

In multi-user operation, 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 /etc/ttys and executes a command for each terminal specified in the file.  This command will usually be /etc/getty.  Getty opens and initializes the terminal line, reads the user’s name, and invokes login to log in the user and execute the shell. 

Ultimately, the shell will terminate because of an end-of-file that is either typed explicitly or generated as a result of hanging up.  The main path of init, which has been waiting for such an event, removes the appropriate entry from the file utmp, which records current users, and makes an entry in /usr/adm/wtmp, which maintains a history of logins and logouts. The wtmp entry is made only if a user logged in successfully on the line.  The appropriate terminal is then reopened and getty(8) is reinvoked.

Init catches the hangup signal (signal SIGHUP) and interprets it to mean that the file /etc/ttys should be read again.  The shell process on each line that was active but no longer exists in ttys 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 phone lines without rebooting the system by changing the ttys file and sending a hangup signal to the init process: use “kill −HUP 1”. 

Init will terminate multi-user operation and resume single-user mode if sent a terminate (TERM) signal, i.e. “kill −TERM 1”.  If there are processes outstanding that are deadlocked (because of hardware or software failure), 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. 

Init will cease creating new getty(8)s and allows the system to die slowly if it receives a terminal stop (TSTP) signal, i.e. “kill −TSTP 1”.  A later hangup will resume full multi-user operation, or a terminate will start a single-user shell. This hook is used by reboot(8) and halt(8).

Init’s role is critical; if it dies, the system reboots itself automatically.  If, at bootstrap time, the init process cannot be located, the system prints the message “can’t exec /etc/init”, and hangs. 

DIAGNOSTICS

/etc/getty gettyargs 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.  Init will sleep for 30 seconds. 

WARNING: Something is hung (won’t die); ps axl advised.  A process hung and could not be killed when the system was shutting down.  This is usually caused by a process stuck in a device driver because of a persistent device-error condition. 

FILES

/dev/console
/dev/tty∗
/etc/utmp
/usr/adm/wtmp
/etc/ttys
/etc/rc

SEE ALSO

login(1), kill(1), sh(1), ttys(5), crash(8R), getty(8), rc(8), reboot(8), halt(8), shutdown(8)

PRPQs 5799-WZQ/5799-PFF: IBM/4.3  —  July 1987

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026