INIT(8) COMMAND REFERENCE INIT(8) NAME init - process control initialization SYNOPSIS /etc/init DESCRIPTION Init is invoked inside UTek as the last step in the boot procedure. It normally runs the automatic startup sequence, which is determined by the shell script /etc/rc. This command file performs housekeeping operations such as removing temporary files, mounting file systems, and starting daemons. If it succeeds, init begins multi-user operation, which is the normal operating mode of UTek, even for a single user workstation. The terms multi-user and single-user are unfortunate artifacts of UTek's heritage as a timesharing operating system. For multi-user operation, init creates a process for each terminal or display port on which a user may log in. It forks as needed to create a process for each port specified in the file /etc/ttys. Each of these processes opens the appropriate port for reading and writing. Opening a port may involve a delay on terminal ports, since the open may not complete until the terminal is fully connected and ready. If a terminal exists but an error occurs when trying to open the terminal, init complains by writing a message to the system console; the message is repeated every 10 minutes for each such terminal until the terminal is shut off in /etc/ttys and init is notified (by a hangup signal, as described here), or the terminal becomes accessible (init checks again every minute). After an open succeeds, /etc/getty is called with the argument specified by the second character of the ttys file line. The command getty reads the user's name and invokes the login command to log in the user and execute the appropriate shell. Ultimately the Shell terminates because an end-of-file was either typed explicitly or was generated as a result of hanging up. The main path of init, which has been waiting for such an event, wakes up and 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. Then the appropriate terminal is reopened and getty is reinvoked. Init catches the hangup signal (signal SIGHUP) and interprets it to mean that the file /etc/ttys should be read again. For ports which were active but are no longer Printed 5/12/88 1
INIT(8) COMMAND REFERENCE INIT(8) active, the controlling process (shell or getty) is terminated. For newly active ports getty is started. Ports 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 terminates multi-user operations and resumes single- user mode if sent a terminate (TERM) signal (i.e., kill -TERM 1). If there are processes outstanding which are deadlocked (due to 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'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 multi-user operations, or a terminate will initiate a single-user shell. This hook is used by reboot(8) and halt(8). Single-user mode provides the console with a shell, with no other user-level processes running. This allows controlled operation of the system such that no background cpu or disk activity can occur. It is required for some maintenance activities, such as checking active file systems. Single-user mode can be entered by several means. Some failures of automatic startup will drop the console into single-user mode. It can be entered intentionally from the boot process or by using the shutdown command with no options in multi-user mode. When single user operation is terminated by killing the single-user shell (i.e., by typing control-D), init runs commences automatic startup. Since all single-user operations are performed as superuser, running in single-user mode is protected by the root passwd, regardless of how it is entered. When the single-user shell is terminated (i.e., by typing control-D), confirmation is requested so that unwanted multi-user activity won't be started inadvertently. FILES /dev/console /dev/tty* /etc/utmp /usr/adm/wtmp /etc/ttys /etc/rc Printed 5/12/88 2
INIT(8) COMMAND REFERENCE INIT(8) DIAGNOSTICS init: tty: cannot open. A terminal which is turned on in the ttys file cannot be opened, usually because the requisite lines are either not configured into the system or the associated device was not attached during boot-time system configuration. WARNING: Something is hung (won't 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. SEE ALSO kill(1), login(1), sh(1sh), ttys(5), getty(8), halt(8), rc(8), reboot(8), and shutdown(8). Printed 5/12/88 3
%%index%% na:240,89; sy:329,195; de:524,3113;3949,2473; fi:6422,244; di:6978,847; se:7825,317; %%index%%000000000118