home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man8 / init.8 < prev    next >
Encoding:
Text File  |  1975-06-26  |  2.8 KB  |  110 lines

  1. .th INIT VIII 2/22/74
  2. .sh NAME
  3. init  \*-  process control initialization
  4. .sh SYNOPSIS
  5. .bd /etc/init
  6. .sh DESCRIPTION
  7. .it Init
  8. is invoked inside UNIX as the last step in the boot procedure.
  9. Generally its role is to create a process for each
  10. typewriter on which a user may log in.
  11. .s3
  12. First,
  13. .it init
  14. checks
  15. to see if the console switches contain 173030.
  16. (This number is likely to vary between
  17. systems.)
  18. If so, the console typewriter
  19. .bd /dev/tty8
  20. is opened for reading
  21. and writing and the Shell is invoked immediately.
  22. This feature is used to bring up a single-user system.
  23. When the system is brought up in this way, the
  24. .it getty
  25. and
  26. .it login
  27. routines mentioned below and described elsewhere are not used.
  28. If the Shell terminates,
  29. .it init
  30. starts over looking for the
  31. console switch setting.
  32. .s3
  33. Otherwise, \fIinit\fR
  34. invokes a Shell, with input taken from the
  35. file
  36. .it /etc/rc.
  37. This command file
  38. performs housekeeping
  39. like removing temporary files,
  40. mounting file systems, and starting
  41. daemons.
  42. .s3
  43. Then
  44. .it init
  45. reads the file
  46. .it /etc/ttys
  47. and
  48. forks several times to create a process
  49. for each typewriter specified in the file.
  50. Each of these processes opens the appropriate typewriter
  51. for reading and writing.  These channels thus
  52. receive file descriptors 0 and 1, the standard input and
  53. output.
  54. Opening the typewriter will usually involve a delay,
  55. since the \fIopen\fR is not completed until someone
  56. is dialed up and carrier established on the channel.
  57. Then
  58. .it /etc/getty
  59. is called with argument as specified by the last character of
  60. the
  61. .it ttys
  62. file line.
  63. .it Getty
  64. reads the user's name and invokes
  65. .it login
  66. (q.v.)
  67. to log in the user and execute the Shell.
  68. .s3
  69. Ultimately the Shell will terminate
  70. because of an end-of-file either
  71. typed explicitly or generated as a result of hanging up.
  72. The main path of \fIinit\fR, which has been waiting
  73. for such an event,
  74. wakes up and removes the appropriate entry from the
  75. file \fIutmp\fR, which records current users, and
  76. makes an entry in \fI/usr/adm/wtmp\fR, which maintains a history
  77. of logins and logouts.
  78. Then the appropriate typewriter is reopened and
  79. .it getty
  80. is
  81. reinvoked.
  82. .s3
  83. .it Init
  84. catches the
  85. .it hangup
  86. signal (signal #1) and interprets it to mean that
  87. the
  88. switches should be examined as in a reboot: if they
  89. indicate a multi-user system, the
  90. .it /etc/ttys
  91. file is read again.
  92. The Shell process on each line which used to be active
  93. in
  94. .it ttys
  95. but is no longer there is terminated;
  96. a new process is created for each added line;
  97. lines unchanged in the file are undisturbed.
  98. Thus it is possible to drop or add phone lines without
  99. rebooting the system by changing the
  100. .it ttys
  101. file and sending a
  102. .it hangup
  103. signal to the
  104. .it init
  105. process: use ``kill \*-1 1.''
  106. .sh FILES
  107. /dev/tty?, /etc/utmp, /usr/adm/wtmp, /etc/ttys, /etc/rc
  108. .sh "SEE ALSO"
  109. login (I), kill (I), sh (I), ttys (V), getty (VIII)
  110.