|
|
1.1 ! root 1: .TH INIT 8 ! 2: .CT 1 sa_auto secur ! 3: .SH NAME ! 4: init \- process control initialization ! 5: .SH SYNOPSIS ! 6: .B /etc/init ! 7: .SH DESCRIPTION ! 8: .I Init ! 9: is invoked by the operating system as the last step in the boot procedure. ! 10: It is always process 1. ! 11: .PP ! 12: When started normally, ! 13: .I init ! 14: calls ! 15: .IR rc (8) ! 16: with parameter ! 17: .BR autoboot . ! 18: If this succeeds, ! 19: .I init ! 20: begins multi-user operation. ! 21: If ! 22: .I rc ! 23: fails, ! 24: .I init ! 25: commences single user operation by giving ! 26: the super-user a shell on the console. ! 27: It is possible to pass parameters ! 28: from the boot program to ! 29: .I init ! 30: so that single user operation is commenced immediately. ! 31: When the single user shell terminates, ! 32: .I init ! 33: runs ! 34: .IR rc ! 35: without the parameter, ! 36: and begins multi-user operation. ! 37: .PP ! 38: .I Rc ! 39: performs housekeeping ! 40: such as checking and mounting file systems ! 41: and starting daemons; ! 42: see ! 43: .IR rc (8). ! 44: .PP ! 45: In multi-user operation, ! 46: .IR init 's ! 47: role is to create a process for each ! 48: directly connected terminal port on which a user may log in. ! 49: To begin such operations, it reads the ! 50: .IR ttys (5) ! 51: file and forks to create a process ! 52: for each terminal specified in the file. ! 53: Each of these processes opens the appropriate terminal ! 54: for reading and writing ! 55: on file descriptors 0, 1, 2, and 3 (the standard input and ! 56: output, the diagnostic output and ! 57: .FR /dev/tty ). ! 58: Opening the terminal will usually involve a delay, ! 59: since the ! 60: .I open ! 61: is not completed until someone ! 62: dials and carrier is established on the channel. ! 63: Then ! 64: .IR getty (8) ! 65: is called with argument as specified by the second character of ! 66: the ! 67: .I ttys ! 68: file line. ! 69: .I Getty ! 70: reads the user's name and invokes ! 71: .IR login (8) ! 72: to log in the user and execute the shell. ! 73: .PP ! 74: Ultimately the shell will terminate ! 75: because of an end-of-file or as a result of hanging up. ! 76: The main path of ! 77: .IR init , ! 78: which has been waiting ! 79: for such an event, ! 80: wakes up and removes the appropriate entry from the ! 81: file ! 82: .IR utmp (5), ! 83: which records current users, and ! 84: makes an entry in ! 85: .IR wtmp , ! 86: which maintains a history ! 87: of logins and logouts. ! 88: Then the appropriate terminal is reopened and ! 89: .I getty ! 90: is ! 91: invoked again. ! 92: .PP ! 93: .I Init ! 94: catches signal ! 95: .B SIGHUP ! 96: and interprets it to mean that ! 97: the ! 98: .I ttys ! 99: file ! 100: should be read again. ! 101: The shell process on each line that has become inactive ! 102: according to ! 103: .I ttys ! 104: is terminated; ! 105: a new process is created for each line added; ! 106: lines unchanged in the file are undisturbed. ! 107: Thus it is possible to drop or add terminal lines without ! 108: rebooting the system by changing the ! 109: .I ttys ! 110: file and sending a ! 111: .I hangup ! 112: signal to the ! 113: .I init ! 114: process: use ! 115: .LR "kill -1 1" . ! 116: .PP ! 117: .I Init ! 118: will terminate multi-user operations, ! 119: kill all outstanding processes, ! 120: and resume single-user mode ! 121: if sent signal ! 122: .BR SIGTERM : ! 123: use ! 124: .LR "kill 1" . ! 125: .I Init ! 126: will wait at most 30 seconds for outstanding processes to die, ! 127: to avoid waiting forever. ! 128: .PP ! 129: If, at bootstrap time, the ! 130: .I init ! 131: program cannot be executed, ! 132: the system will loop in user mode at a low address. ! 133: .SH FILES ! 134: .nf ! 135: .F /dev/console ! 136: .F /dev/tty ! 137: .F /etc/utmp ! 138: .F /usr/adm/wtmp ! 139: .F /etc/ttys ! 140: .F /etc/rc ! 141: .fi ! 142: .SH "SEE ALSO" ! 143: .IR login (8), ! 144: .IR kill (1), ! 145: .IR sh (1), ! 146: .IR ttys (5), ! 147: .IR getty (8), ! 148: .IR rc (8), ! 149: .IR reboot (8) ! 150: .SH BUGS ! 151: .IR Init 's ! 152: multi-user functions should be integrated ! 153: with the world of ! 154: .IR svcmgr (8).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.