| 1 | |
| 2 | |
| 3 | |
| 4 | INIT(8) 1990 INIT(8) |
| 5 | |
| 6 | |
| 7 | |
| 8 | N\bNA\bAM\bME\bE |
| 9 | init - process control initialization |
| 10 | |
| 11 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS |
| 12 | /\b/e\bet\btc\bc/\b/i\bin\bni\bit\bt |
| 13 | |
| 14 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN |
| 15 | _\bI_\bn_\bi_\bt is invoked inside UNIX as the last step in the boot |
| 16 | procedure. It normally then runs the automatic reboot |
| 17 | sequence as described in _\br_\be_\bb_\bo_\bo_\bt(8), and if this succeeds, |
| 18 | begins multi-user operation. If the reboot fails, it com- |
| 19 | mences single user operation by giving the super-user a |
| 20 | shell on the console. It is possible to pass parameters |
| 21 | from the boot program to _\bi_\bn_\bi_\bt so that single user operation |
| 22 | is commenced immediately. When such single user operation |
| 23 | is terminated by killing the single-user shell (i.e. by hit- |
| 24 | ting ^D), _\bi_\bn_\bi_\bt runs /_\be_\bt_\bc/_\br_\bc without the reboot parameter. |
| 25 | This command file performs housekeeping operations such as |
| 26 | removing temporary files, mounting file systems, and start- |
| 27 | ing daemons. |
| 28 | |
| 29 | In multi-user operation, _\bi_\bn_\bi_\bt'_\bs role is to create a process |
| 30 | for each terminal port on which a user may log in. To begin |
| 31 | such operations, it reads the file /_\be_\bt_\bc/_\bt_\bt_\by_\bs and executes a |
| 32 | command for each terminal specified in the file. This com- |
| 33 | mand will usually be /_\bu_\bs_\br/_\bl_\bi_\bb_\be_\bx_\be_\bc/_\bg_\be_\bt_\bt_\by. _\bG_\be_\bt_\bt_\by opens and |
| 34 | initializes the terminal line, reads the user's name and |
| 35 | invokes _\bl_\bo_\bg_\bi_\bn to log in the user and execute the Shell. |
| 36 | |
| 37 | Ultimately the Shell will terminate because of an end-of- |
| 38 | file either typed explicitly or generated as a result of |
| 39 | hanging up. The main path of _\bi_\bn_\bi_\bt, which has been waiting |
| 40 | for such an event, wakes up and removes the appropriate |
| 41 | entry from the file _\bu_\bt_\bm_\bp, which records current users, and |
| 42 | makes an entry in /_\bv_\ba_\br/_\bl_\bo_\bg/_\bw_\bt_\bm_\bp, which maintains a history |
| 43 | of logins and logouts. The _\bw_\bt_\bm_\bp entry is made only if a |
| 44 | user logged in successfully on the line. Then the appropri- |
| 45 | ate terminal is reopened and _\bg_\be_\bt_\bt_\by is reinvoked. |
| 46 | |
| 47 | _\bI_\bn_\bi_\bt catches the _\bh_\ba_\bn_\bg_\bu_\bp signal (signal SIGHUP) and inter- |
| 48 | prets it to mean that the file /_\be_\bt_\bc/_\bt_\bt_\by_\bs should be read |
| 49 | again. The Shell process on each line which used to be |
| 50 | active in _\bt_\bt_\by_\bs but is no longer there is terminated; a new |
| 51 | process is created for each added line; lines unchanged in |
| 52 | the file are undisturbed. Thus it is possible to drop or |
| 53 | add terminal lines without rebooting the system by changing |
| 54 | the _\bt_\bt_\by_\bs file and sending a _\bh_\ba_\bn_\bg_\bu_\bp signal to the _\bi_\bn_\bi_\bt pro- |
| 55 | cess: use `kill -HUP 1.' |
| 56 | |
| 57 | _\bI_\bn_\bi_\bt will terminate multi-user operations and resume |
| 58 | single-user mode if sent a terminate (TERM) signal, i.e. |
| 59 | ``kill -TERM 1''. If there are processes outstanding which |
| 60 | |
| 61 | |
| 62 | |
| 63 | Printed 7/27/90 June 1 |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | INIT(8) 1990 INIT(8) |
| 71 | |
| 72 | |
| 73 | |
| 74 | are deadlocked (due to hardware or software failure), _\bi_\bn_\bi_\bt |
| 75 | will not wait for them all to die (which might take for- |
| 76 | ever), but will time out after 30 seconds and print a warn- |
| 77 | ing message. |
| 78 | |
| 79 | _\bI_\bn_\bi_\bt will cease creating new _\bg_\be_\bt_\bt_\by's and allow the system to |
| 80 | slowly die away, if it is sent a terminal stop (TSTP) sig- |
| 81 | nal, i.e. ``kill -TSTP 1''. A later hangup will resume full |
| 82 | multi-user operations, or a terminate will initiate a single |
| 83 | user shell. This hook is used by _\br_\be_\bb_\bo_\bo_\bt(8) and _\bh_\ba_\bl_\bt(8). |
| 84 | |
| 85 | _\bI_\bn_\bi_\bt'_\bs role is so critical that if it dies, the system will |
| 86 | reboot itself automatically. If, at bootstrap time, the |
| 87 | _\bi_\bn_\bi_\bt process cannot be located, the system will loop in user |
| 88 | mode at location 0x13. |
| 89 | |
| 90 | D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS |
| 91 | /\b/u\bus\bsr\br/\b/l\bli\bib\bbe\bex\bxe\bec\bc/\b/g\bge\bet\btt\bty\by _\bg_\be_\bt_\bt_\by_\ba_\br_\bg_\bs f\bfa\bai\bil\bli\bin\bng\bg,\b, s\bsl\ble\bee\bep\bpi\bin\bng\bg. A process |
| 92 | being started to service a line is exiting quickly each time |
| 93 | it is started. This is often caused by a ringing or noisy |
| 94 | terminal line. _\bI_\bn_\bi_\bt _\bw_\bi_\bl_\bl _\bs_\bl_\be_\be_\bp _\bf_\bo_\br _\b3_\b0 _\bs_\be_\bc_\bo_\bn_\bd_\bs, |
| 95 | |
| 96 | W\bWA\bAR\bRN\bNI\bIN\bNG\bG:\b: S\bSo\bom\bme\bet\bth\bhi\bin\bng\bg i\bis\bs h\bhu\bun\bng\bg (\b(w\bwo\bon\bnt\bt d\bdi\bie\be)\b);\b; p\bps\bs a\bax\bxl\bl a\bad\bdv\bvi\bis\bse\bed\bd. A |
| 97 | process is hung and could not be killed when the system was |
| 98 | shutting down. This is usually caused by a process which is |
| 99 | stuck in a device driver due to a persistent device error |
| 100 | condition. |
| 101 | |
| 102 | F\bFI\bIL\bLE\bES\bS |
| 103 | /dev/console, /dev/tty*, /var/run/utmp, /var/log/wtmp, |
| 104 | /etc/ttys, /etc/rc |
| 105 | |
| 106 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO |
| 107 | login(1), kill(1), sh(1), ttys(5), crash(8V), getty(8), |
| 108 | rc(8), reboot(8), halt(8), shutdown(8) |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | Printed 7/27/90 June 2 |
| 130 | |
| 131 | |
| 132 | |