INIT(8) COMMAND REFERENCE INIT(8) NAME init - process control initialization SYNOPSIS /etc/init DESCRIPTION init is invoked as the last step in the boot procedure. It normally runs the automatic startup sequence 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 successful, init begins multi-user operation, the normal operating mode of UTek for multi- and single-user workstations. For multi-user operation, init creates a process for each terminal or display port a user is logged into. It forks 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 it, init complains by writing a message to the system file /usr/adm/sulog. The message is repeated every 10 minutes for each terminal until it 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, init executes the command for that port as specified in the file /etc/ttys. This command is usually /etc/getty. The command getty reads the user's name and invokes the login command to log in the user and execute the appropriate shell. When the shell terminates because an end-of-file is typed or generated as a result of hanging up, init removes the appropriate entry from the file utmp that records current users. init then makes an entry in /usr/adm/wtmp that 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 that are no longer 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 Printed 4/7/89 1
INIT(8) COMMAND REFERENCE INIT(8) 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 (kill -TERM 1). If there are processes outstanding that are deadlocked due to hardware or software failure, init will not wait for them all to die. It 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 (kill -TSTP 1). A later hangup will resume full multi-user operations or a terminate will initiate a single-user shell. This facility 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 controls operation of the system so 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 several ways: Intentionally from the boot process or by using the shutdown command with no options in multi-user mode. Also, some failures of automatic startup will drop the console into single-user mode. When single-user operation is terminated by killing the single-user shell with a control-D, init runs automatic startup. Since all single-user operations are performed as superuser, running in single-user mode is protected by the root password regardless of how it is entered. When the single-user shell is terminated with a control-D, confirmation is requested so that unwanted multi-user activity can't be started inadvertently. FILES /dev/console /dev/tty* /etc/utmp /usr/adm/wtmp /etc/ttys /etc/rc 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 Printed 4/7/89 2
INIT(8) COMMAND REFERENCE INIT(8) 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), shutdown(8) Printed 4/7/89 3
%%index%% na:240,89; sy:329,195; de:524,3187;4023,2041; fi:6064,244; di:6308,442;7062,405; se:7467,318; %%index%%000000000127