OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man7 / boot.7
1 .\" Written by Oron Peled <oron@actcom.co.il>.
2 .\" May be distributed subject to the GPL.
3 .\"
4 .\" I tried to be as much generic in the description as possible:
5 .\" - General boot sequence is applicable to almost any
6 .\" OS/Machine (DOS/PC, Linux/PC, Solaris/SPARC, CMS/S390)
7 .\" - kernel and init(8) is applicable to almost any UNIX/Linux
8 .\" - boot scripts are applicable to SYSV-R4 based UNIX/Linux
9 .\"
10 .\" Modified 2004-11-03 patch from Martin Schulze <joey@infodrom.org>
11 .\"
12 .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
13 .\" Translated 2002-08-07, NAKANO Takeo <nakano@apm.seikei.ac.jp>
14 .\" Updated 2005-02-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
15 .\"
16 .TH BOOT 7 2010-09-19 "Linux" "Linux Programmer's Manual"
17 .\"O .SH NAME
18 .\"O boot-scripts \- General description of boot sequence
19 .SH Ì¾Á°
20 boot-scripts \- ¥Ö¡¼¥È¥·¡¼¥±¥ó¥¹¤Î°ìÈÌŪ¤Ê²òÀâ
21 .\"O .SH DESCRIPTION
22 .SH ÀâÌÀ
23 .\"O .LP
24 .\"O The boot sequence varies in details among systems
25 .\"O but can be roughly divided to the following steps:
26 .\"O (i) hardware boot, (ii) OS loader,
27 .\"O (iii) kernel startup, (iv) init and inittab,
28 .\"O (v) boot scripts.
29 .\"O We will describe each of these in more detail below.
30 ºÙ¤«¤¤¤È¤³¤í¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¤¬¡¢Âç¤Þ¤«¤Ë¸À¤¦¤È¡¢
31 ¥Ö¡¼¥È¥·¡¼¥±¥ó¥¹¤Ï°Ê²¼¤ÎÃʳ¬¤Ëʬ¤±¤é¤ì¤ë:
32 (1) ¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ö¡¼¥È (2) OS ¥í¡¼¥À¡¼
33 (3) ¥«¡¼¥Í¥ë¤Îµ¯Æ° (4) init ¤È inittab
34 (5) ¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È
35 .\"O .SS "Hardware-boot"
36 .SS ¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ö¡¼¥È
37 .\"O After power-on or hard reset, control is given
38 .\"O to a program stored on read-only memory (normally
39 .\"O PROM).
40 .\"O In PC we usually call this program the \fBBIOS\fR.
41 ÅŸ»ÅêÆþ¤ä¥Ï¡¼¥É¥ê¥»¥Ã¥È¤¬¹Ô¤ï¤ì¤ë¤È¡¢
42 ROM (Ä̾ï¤Ï PROM) ¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤ËÀ©¸æ¤¬ÅϤµ¤ì¤ë¡£
43 PC ¤Ç¤Ï¤³¤Î¥×¥í¥°¥é¥à¤ÏÄ̾ï \fBBIOS\fR ¤È¸Æ¤Ð¤ì¤ë¡£
44
45 .\"O This program normally makes a basic self-test of the
46 .\"O machine and accesses nonvolatile memory to read
47 .\"O further parameters.
48 .\"O This memory in the PC is
49 .\"O battery-backed CMOS memory, so most people
50 .\"O refer to it as the \fBCMOS\fR, although outside
51 .\"O of the PC world, it is usually called \fBnvram\fR
52 .\"O (nonvolatile ram).
53 ¤Õ¤Ä¤¦¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢¤Þ¤º¥Þ¥·¥ó¤Î´ðËÜŪ¤Ê¼«¸Ê¿ÇÃǤò¹Ô¤¤¡¢
54 ¤½¤·¤ÆÉÔ´øȯÀ­¥á¥â¥ê¤Ë¥¢¥¯¥»¥¹¤·¤Æ³Æ¼ï¤Î¥Ñ¥é¥á¡¼¥¿¤òÆɤ߹þ¤à¡£
55 PC ¤Ç¤Ï¡¢¤³¤Î¥á¥â¥ê¤ÏÅÅÃӤˤè¤Ã¤Æ¥Ð¥Ã¥¯¥¢¥Ã¥×¤µ¤ì¤Æ¤¤¤ë CMOS ¥á¥â¥ê¤Ç¤¢¤ë¡£
56 ¤½¤Î¤¿¤á \fBCMOS\fR ¤È¸Æ¤Ð¤ì¤ë¤³¤È¤¬Â¿¤¤¡£
57 ¤·¤«¤· PC °Ê³°¤ÎÀ¤³¦¤Ç¤Ï¡¢Ä̾ï \fBnvram\fR
58 (nonvolatile ram) ¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£
59
60 .\"O The parameters stored in the nvram vary between
61 .\"O systems, but as a minimum, the hardware boot program
62 .\"O should know what is the boot device, or which devices
63 .\"O to probe as possible boot devices.
64 nvram ¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥Ñ¥é¥á¡¼¥¿¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
65 ¤·¤«¤·¡¢¥Ï¡¼¥É¥¦¥§¥¢¥Ö¡¼¥È¥×¥í¥°¥é¥à¤Ï¡¢¾¯¤Ê¤¯¤È¤â¡¢
66 ¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤¬¤É¤ì¤Ç¤¢¤ë¤«¡¢¤â¤·¤¯¤Ï
67 ¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤È¤·¤Æõº÷¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬¤É¤ì¤Ç¤¢¤ë¤«¤ò
68 ÃΤäƤ¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
69
70 .\"O Then the hardware boot stage accesses the boot device,
71 .\"O loads the OS Loader, which is located on a fixed position
72 .\"O on the boot device, and transfers control to it.
73 ¥Ï¡¼¥É¥¦¥§¥¢¥Ö¡¼¥È¤Î¥·¡¼¥±¥ó¥¹¤Ï¡¢¼¡¤Ë¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë¥¢¥¯¥»¥¹¤·¡¢
74 ¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤Î¤¢¤é¤«¤¸¤á·è¤Þ¤Ã¤¿¾ì½ê¤ËÃÖ¤«¤ì¤Æ¤¤¤ë
75 OS ¥í¡¼¥À¡¼¤ò¥í¡¼¥É¤·¡¢À©¸æ¤òÅϤ¹¡£
76 .TP
77 .\"O Note:
78 .\"O We do not cover here booting from network.
79 .\"O Those who want
80 .\"O to investigate this subject may want to research:
81 .\"O DHCP, TFTP, PXE, Etherboot.
82 Ãí°Õ:
83 ¤³¤³¤Ç¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï¿¨¤ì¤Ê¤¤¡£
84 ¤³¤ÎÏÃÂê¤Ë¤Ä¤¤¤ÆÄ´ºº¤·¤¿¤¤ÆɼԤϡ¢
85 DHCP, TFTP, PXE, Etherboot Åù¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤Æ¤ß¤ë¤È¤è¤¤¡£
86 .\"O .SS "OS Loader"
87 .SS OS ¥í¡¼¥À¡¼
88 .\"O In PC, the OS Loader is located in the first sector
89 .\"O of the boot device \- this is the \fBMBR\fR
90 .\"O (Master Boot Record).
91 PC ¤Ç¤Ï¡¢OS ¥í¡¼¥À¡¼¤Ï¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤ÎÀèƬ¥»¥¯¥¿¤ËÃÖ¤«¤ì¤ë¡£
92 ¤³¤ì¤Ï \fBMBR\fR (Master Boot Record) ¤È¸Æ¤Ð¤ì¤ë¡£
93
94 .\"O In most systems, this primary loader is very
95 .\"O limited due to various constraints.
96 .\"O Even on non-PC systems
97 .\"O there are some limitations to the size and complexity
98 .\"O of this loader, but the size limitation of the PC MBR
99 .\"O (512 bytes including the partition table) makes it
100 .\"O almost impossible to squeeze a full OS Loader into it.
101 ÍÍ¡¹¤ÊÀ©Ìó¤Î¤¿¤á¡¢
102 ¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤ÇÂè°ì¥í¡¼¥À¡¼¤ÏÈó¾ï¤Ë´Êñ¤Êµ¡Ç½¤·¤«»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
103 PC °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤â¡¢
104 ¥µ¥¤¥º¤ÎÀ©¸Â¤ä¥í¡¼¥À¡¼¤Îµ¡Ç½¤Ê¤É¤Ë¤¢¤ëÄøÅÙ¤ÎÀ©¸Â¤Ï¸ºß¤¹¤ë¡£
105 ¤·¤«¤·¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ò´Þ¤á¤Æ 512 ¥Ð¥¤¥È¤È¤¤¤¦
106 PC ¤Î MBR ¤Ç¤Ï¡¢OS ¥í¡¼¥À¡¼¤ÎÁ´µ¡Ç½¤ò¤³¤³¤Ë²¡¤·¹þ¤à¤Î¤Ï¤Þ¤ºÉÔ²Äǽ¤À¡£
107
108 .\"O Therefore, most operating systems make the primary loader
109 .\"O call a secondary OS loader which may be located on
110 .\"O a specified disk partition.
111 ¤·¤¿¤¬¤Ã¤ÆÂçÄñ¤Î OS ¤Ç¤Ï¡¢Âè°ì¥í¡¼¥À¡¼¤ÏÂèÆó¥í¡¼¥À¡¼¤ò¸Æ¤Ö¤è¤¦¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢
112 ¸å¼Ô¤Ï¤¢¤é¤«¤¸¤á»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥¯¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ËÃÖ¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
113
114 .\"O In Linux the OS loader is normally
115 .\"O .BR lilo (8)
116 .\"O or
117 .\"O .BR grub (8).
118 .\"O Both of them may install either as secondary loaders
119 .\"O (where the DOS installed MBR points to them), or
120 .\"O as a two part loader where they provide special MBR
121 .\"O containing the bootstrap code to load the second part
122 .\"O of the loader from the root partition.
123 Linux ¤Ë¤ª¤±¤ë OS ¥í¡¼¥À¡¼¤Ï¡¢¤Õ¤Ä¤¦
124 .BR lilo (8)
125 ¤«
126 .BR grub (8)
127 ¤Ç¤¢¤ë¡£Î¾¼Ô¤È¤âÂèÆó¥í¡¼¥À¡¼¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤â¤Ç¤­
128 (¤³¤Î¾ì¹ç DOS ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ MBR ¤¬¤³¤ì¤é¤ò»Ø¤¹¤è¤¦¤Ë¤¹¤ë)¡¢
129 ¤Þ¤¿Âè°ì¡¦ÂèÆó¥í¡¼¥À¡¼¤ÎξÊý¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£
130 ¸å¼Ô¤Î¾ì¹ç¸þ¤±¤Ë¡¢Î¾¼Ô¤ÏÆÃÊ̤ʠMBR ¥¤¥á¡¼¥¸¤òÄ󶡤·¤Æ¤¤¤ë¡£
131 ¤³¤ì¤Ë¤ÏÂèÆó¥í¡¼¥À¡¼¤ò¥ë¡¼¥È¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤«¤é¥í¡¼¥É¤¹¤ë¤è¤¦¤Ê
132 ¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¥³¡¼¥É¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£
133
134 .\"O The main job of the OS Loader is to locate the kernel
135 .\"O on the disk, load it and run it.
136 .\"O Most OS loaders allow
137 .\"O interactive use, to enable specification of alternative
138 .\"O kernel (maybe a backup in case the last compiled one
139 .\"O isn't functioning) and to pass optional parameters
140 .\"O to the kernel.
141 OS ¥í¡¼¥À¡¼¤Î¼ç¤Ê»Å»ö¤Ï¡¢¥«¡¼¥Í¥ë¤Î¥Ç¥£¥¹¥¯¾å¤Î°ÌÃÖ¤òÆÃÄꤷ¡¢
142 ¥í¡¼¥É¤·¤Æµ¯Æ°¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£¤Û¤È¤ó¤É¤Î OS ¥í¡¼¥À¡¼¤Ï¡¢
143 ÂÐÏå⡼¥É¤Ç»ÈÍѤ¹¤ë¤³¤È¤â¤Ç¤­¡¢ÄɲäΥѥé¥á¡¼¥¿¤ò¥«¡¼¥Í¥ë¤ËÅϤ·¤¿¤ê¡¢
144 ¥Ç¥Õ¥©¥ë¥È¤È¤ÏÊ̤Υ«¡¼¥Í¥ë¤ò»ØÄꤷ¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë
145 (Î㤨¤Ð¡¢ºÇ¸å¤Ë¥³¥ó¥Ñ¥¤¥ë¤·¤¿¥«¡¼¥Í¥ë¤¬µ¡Ç½¤·¤Ê¤«¤Ã¤¿»þ¤Ë
146 ¥Ð¥Ã¥¯¥¢¥Ã¥×¤Î¥«¡¼¥Í¥ë¤ò»ØÄꤷ¤Æµ¯Æ°¤¹¤ë¤È¤¤¤Ã¤¿¤³¤È¤¬¤Ç¤­¤ë)¡£
147 .\"O .SS "Kernel Startup"
148 .SS ¥«¡¼¥Í¥ë¤Îµ¯Æ°
149 .\"O When the kernel is loaded, it initializes the devices (via
150 .\"O their drivers), starts the swapper (it is a "kernel process",
151 .\"O called kswapd in modern Linux kernels), and mounts the root
152 .\"O file system (/).
153 ¥«¡¼¥Í¥ë¤Ï¥í¡¼¥É¤µ¤ì¤ë¤È¡¢¥Ç¥Ð¥¤¥¹¤ò (¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ)
154 ½é´ü²½¤·¡¢¥¹¥ï¥Ã¥Ñ¤òµ¯Æ°¤· (ºÇ¶á¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢
155 ¥¹¥ï¥Ã¥Ñ¤Ï kswapd ¤È¤¤¤¦¡Ö¥«¡¼¥Í¥ë¥×¥í¥»¥¹¡×¤Ë¤Ê¤ë)¡¢
156 ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (/) ¤ò¥Þ¥¦¥ó¥È¤¹¤ë¡£
157
158 .\"O Some of the parameters that may be passed to the kernel
159 .\"O relate to these activities (e.g: You can override the
160 .\"O default root file system).
161 .\"O For further information
162 .\"O on Linux kernel parameters read
163 .\"O .BR bootparam (7).
164 ¥«¡¼¥Í¥ë¤ËÅϤ¹¤³¤È¤Î¤Ç¤­¤ë¥Ñ¥é¥á¡¼¥¿¤Î¤¤¤¯¤Ä¤«¤Ï¡¢
165 ¤³¤ì¤é¤ÎÆ°ºî¤Ë´Ø·¸¤¹¤ë¡£
166 (Î㤨¤Ð¥Ç¥Õ¥©¥ë¥È¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£
167 Linux ¥«¡¼¥Í¥ë¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï
168 .BR bootparam (7)
169 ¤òÆɤó¤Ç¤Û¤·¤¤¡£
170
171 .\"O Only then the kernel creates the first (user land)
172 .\"O process which is numbered 1.
173 .\"O This process executes the
174 .\"O program
175 .\"O .IR /sbin/init ,
176 .\"O passing any parameters that weren't handled by the kernel already.
177 ¤³¤ì¤é¤¬ºÑ¤ó¤Ç¤Ï¤¸¤á¤Æ¡¢
178 ¥«¡¼¥Í¥ë¤ÏºÇ½é¤Î (¥æ¡¼¥¶¥é¥ó¥É¤Î) ¥×¥í¥»¥¹¤òÀ¸À®¤·¡¢
179 ÈÖ¹æ 1 ¤òÍ¿¤¨¤ë¡£¤³¤Î¥×¥í¥»¥¹¤Ï
180 .I /sbin/init
181 ¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¡£
182 ¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ñ¥é¥á¡¼¥¿¤Ï¤¹¤Ù¤Æ
183 .I /sbin/init
184 ¤ËÅϤµ¤ì¤ë¡£
185 .\"O .SS "init and inittab"
186 .SS init ¤È inittab
187 .\"O When init starts it reads
188 .\"O .I /etc/inittab
189 .\"O for further instructions.
190 .\"O This file defines what should be run in different \fIrun-levels\fR.
191 init ¤Ï¡¢µ¯Æ°¤¹¤ë¤È¤Þ¤º
192 .I /etc/inittab
193 ¤òÆɤߡ¢¤½¤Î¸å¤Î¹ÔÆ°¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÀ¤ë¡£
194 ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï
195 .I ¥é¥ó¥ì¥Ù¥ë
196 ¤Ë¤è¤Ã¤Æ¤É¤Î¤è¤¦¤ÊÆ°ºî¤ò¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¤«¤òÄêµÁ¤¹¤ë¡£
197
198 .\"O This gives the system administrator an easy management scheme, where
199 .\"O each run-level is associated with a set of services (e.g:
200 .\"O \fBS\fR is \fIsingle-user\fR, on \fB2\fR most network
201 .\"O services start, etc.).
202 .\"O The administrator may change the current
203 .\"O run-level via
204 .\"O .BR init (8)
205 .\"O and query the current run-level via
206 .\"O .BR runlevel (8).
207 ¤³¤ì¤Ë¤è¤Ã¤Æ¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Î´ÉÍý¤¬³Ú¤Ë¤Ê¤ë¡£
208 ³Æ\fI¥é¥ó¥ì¥Ù¥ë\fR¤ÏÄ󶡤¹¤ë¥µ¡¼¥Ó¥¹¤Î½¸¹ç¤ËÂбþ¤¹¤ë
209 (Î㤨¤Ð \fBS\fR ¤Ï \fI¥·¥ó¥°¥ë¥æ¡¼¥¶\fR¡¢
210 \fB2\fR ¤Ç¤ÏÂçÄñ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤¹¤ë¡¢¤Ê¤É)¡£
211 ¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Ï¡¢
212 .BR init (8)
213 ¤òÍѤ¤¤Æ¸½ºß¤Î¥é¥ó¥ì¥Ù¥ë¤òÊѹ¹¤Ç¤­¡¢
214 .BR runlevel (8)
215 ¤Ë¤è¤Ã¤Æ¸½ºß¤Î¥é¥ó¥ì¥Ù¥ë¤ò³Îǧ¤Ç¤­¤ë¡£
216
217 .\"O However, since it is not convenient to manage individual services
218 .\"O by editing this file, inittab only bootstraps a set of scripts
219 .\"O that actually start/stop the individual services.
220 ¤·¤«¤·¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤·¤Æ¸Ä¡¹¤Î¥µ¡¼¥Ó¥¹¤ò´ÉÍý¤¹¤ë¤Î¤ÏÉÔÊؤʤΤǡ¢
221 inittab ¤Ïñ¤Ë¥¹¥¯¥ê¥×¥È¤Î½¸¹ç¤ËÂФ¹¤ë¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
222 ¼ÂºÝ¤Î¸Ä¡¹¤Î¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¤äÄä»ß¤Ï¡¢¤³¤ì¤é¤Î¥¹¥¯¥ê¥×¥È¤Ç¹Ô¤¦¡£
223 .\"O .SS "Boot Scripts"
224 .SS ¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È
225 .\"O
226 .TP
227 .\"O Note:
228 .\"O The following description applies to System V release 4-based systems, which
229 .\"O currently covers most commercial UNIX systems (Solaris, HP-UX, Irix, Tru64)
230 .\"O as well as the major Linux distributions (Red Hat, Debian, Mandriva,
231 .\"O SUSE, Ubuntu).
232 .\"O Some systems (Slackware Linux, FreeBSD, OpenBSD)
233 .\"O have a somewhat different scheme of boot scripts.
234 Ãí°Õ:
235 °Ê²¼¤ÎÀâÌÀ¤Ï System V Release 4 ¤ò¥Ù¡¼¥¹¤È¤·¤¿¥·¥¹¥Æ¥à¤Ë´Ø¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
236 ¸½ºß¤ÎÂçÄñ¤Î¾¦ÍÑ UNIX ¥·¥¹¥Æ¥à (Solaris, HP-UX, Irix, Tru64) ¤ä¡¢
237 ¥á¥¸¥ã¡¼¤Ê Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó (Red Hat, Debian, Mandriva,
238 SUSE, Ubuntu) ¤Ï¤³¤ì¤ò¥Ù¡¼¥¹¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£
239 ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤Îµ¡¹½¤¬
240 ¤¤¤¯¤é¤«°Û¤Ê¤ë¤³¤È¤â¤¢¤ë (Slackware Linux, FreeBSD, OpenBSD ¤Ê¤É)¡£
241 .LP
242 .\"O For each managed service (mail, nfs server, cron, etc.) there is
243 .\"O a single startup script located in a specific directory
244 .\"O .RI ( /etc/init.d
245 .\"O in most versions of Linux).
246 .\"O Each of these scripts accepts as a single argument
247 .\"O the word "start" \-\- causing it to start the service, or the word
248 .\"O \&"stop" \-\- causing it to stop the service.
249 .\"O The script may optionally
250 .\"O accept other "convenience" parameters (e.g: "restart", to stop and then
251 .\"O start, "status" do display the service status).
252 .\"O Running the script
253 .\"O without parameters displays the possible arguments.
254 ´ÉÍý¤¹¤Ù¤­³Æ¥µ¡¼¥Ó¥¹ (¥á¡¼¥ë¡¢nfs ¥µ¡¼¥Ð¡¢cron ¤Ê¤É¤Ê¤É)
255 ¤½¤ì¤¾¤ì¤ËÂФ·¤Æ¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤¬¤Ò¤È¤Ä¤º¤ÄÆÃÄê¤Î¥Ç¥£¥ì¥¯¥È¥ê
256 (¤Û¤È¤ó¤É¤Î Linux ¤Ç
257 .IR /etc/init.d )
258 ¤ËÇÛÃÖ¤µ¤ì¤ë¡£¤³¤ì¤é¤Î¥¹¥¯¥ê¥×¥È¤Ï¡¢
259 ¤½¤ì¤¾¤ì°ú¿ô¤È¤·¤Æ¤Ò¤È¤Ä¤Îñ¸ì¤ò¼è¤ë¡£"start" ¤¬»ØÄꤵ¤ì¤ë¤È
260 ¤½¤Î¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤·¡¢"stop" ¤¬»ØÄꤵ¤ì¤ë¤È¥µ¡¼¥Ó¥¹¤òÄä»ß¤¹¤ë¡£
261 ¥¹¥¯¥ê¥×¥È¤Ï¾¤Î¡ÖÊØÍø¤Ê¡×°ú¿ô¤ò¼è¤Ã¤Æ¤â¤è¤¤
262 (Î㤨¤Ð "restart" ¤ÇÄä»ß¡¦µ¯Æ°¤ò½çÈ֤˹Ԥ俤ꡢ"status"
263 ¤Ç¥µ¡¼¥Ó¥¹¤Î¾õÂÖ¤òɽ¼¨¤¹¤ë¤Ê¤É)¡£
264 ¥¹¥¯¥ê¥×¥È¤ò°ú¿ô¤Ê¤·¤Ç¼Â¹Ô¤¹¤ë¤È¡¢
265 »ØÄê¤Ç¤­¤ë°ú¿ô¤Î°ìÍ÷¤¬É½¼¨¤µ¤ì¤ë¡£
266 .\"O .SS "Sequencing Directories"
267 .SS ½ç½ø¤Å¤±¥Ç¥£¥ì¥¯¥È¥ê
268 .\"O To make specific scripts start/stop at specific run-levels and in
269 .\"O specific order, there are \fIsequencing directories\fR.
270 .\"O These
271 .\"O are normally in \fI/etc/rc[0\-6S].d\fR.
272 .\"O In each of these directories
273 .\"O there are links (usually symbolic) to the scripts in the \fI/etc/init.d\fR
274 .\"O directory.
275 ¤¢¤ë¥é¥ó¥ì¥Ù¥ë¤Ç¡¢ÆÃÄê¤Î¥¹¥¯¥ê¥×¥È¤ò»ØÄꤷ¤¿½ç½ø¤Ç¼Â¹Ô¤µ¤»¤ë¤¿¤á¡¢
276 .I ½ç½øÉÕ¤±¥Ç¥£¥ì¥¯¥È¥ê (sequencing directory)
277 ¤È¤¤¤¦»ÅÁȤߤ¬Â¸ºß¤¹¤ë¡£
278 ¤³¤ì¤é¤Ï¤Õ¤Ä¤¦
279 .I /etc/rc[0\-6S].d
280 ¤Ç¤¢¤ë¡£³Æ¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÉô¤Ë¤Ï¡¢
281 .I /etc/init.d
282 ¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤¿¥¹¥¯¥ê¥×¥È¤Ø¤Î¥ê¥ó¥¯ (¤Õ¤Ä¤¦¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯)
283 ¤¬ÃÖ¤«¤ì¤ë¡£
284
285 .\"O A primary script (usually \fI/etc/rc\fR) is called from
286 .\"O .BR inittab (5)
287 .\"O and calls the services scripts via the links in the sequencing directories.
288 .\"O All links with names that begin with \(aqS\(aq are being called with
289 .\"O the argument "start" (thereby starting the service).
290 .\"O All links with
291 .\"O names that begin with \(aqK\(aq are being called with the argument "stop"
292 .\"O (thereby stopping the service).
293 Âè°ì¥¹¥¯¥ê¥×¥È (Ä̾ï
294 .IR /etc/rc )
295 ¤Ï
296 .BR inittab (5)
297 ¤«¤é¸Æ¤Ð¤ì¡¢
298 ½ç½øÉÕ¤±¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤¿¥ê¥ó¥¯·Ðͳ¤Ç³Æ¥µ¡¼¥Ó¥¹¥¹¥¯¥ê¥×¥È¤ò¸Æ¤Ó½Ð¤¹¡£
299 ̾Á°¤¬ \(aqS\(aq ¤Ç¤Ï¤¸¤Þ¤ë¥ê¥ó¥¯¤Ï "start" ¤È¤¤¤¦°ú¿ô¤ò¤Ä¤±¤Æ¸Æ¤Ó½Ð¤µ¤ì
300 (¤¹¤Ê¤ï¤Á¥µ¡¼¥Ó¥¹¤¬µ¯Æ°¤·)¡£Ì¾Á°¤¬ \(aqK\(aq ¤Ç¤Ï¤¸¤Þ¤ë¥ê¥ó¥¯¤Ï "stop"
301 ¤È¤¤¤¦°ú¿ô¤ò¤Ä¤±¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë (¤¹¤Ê¤ï¤Á¥µ¡¼¥Ó¥¹¤¬Ää»ß¤¹¤ë)¡£
302
303 .\"O To define the starting or stopping order within the same run-level,
304 .\"O the names of the links contain order-numbers.
305 .\"O Also, to make the names clearer, they usually
306 .\"O end with the name of the service they refer to.
307 .\"O Example:
308 .\"O the link \fI/etc/rc2.d/S80sendmail\fR starts the sendmail service on
309 .\"O runlevel 2.
310 .\"O This happens after \fI/etc/rc2.d/S12syslog\fR is run
311 .\"O but before \fI/etc/rc2.d/S90xfs\fR is run.
312 Ʊ¤¸¥é¥ó¥ì¥Ù¥ë¤ÎÆâÉô¤Ç¤Îµ¯Æ°¤äÄä»ß¤Î½ç½ø¤òµ¬Äꤹ¤ë¤¿¤á¤Ë¡¢
313 ¥ê¥ó¥¯¤Î̾Á°¤Ë¤Ï½ç½ø¤ò¼¨¤¹¿ô»ú¤¬´Þ¤Þ¤ì¤ë¡£
314 ¤Þ¤¿¡¢Ì¾Á°¤ò¤ï¤«¤ê¤ä¤¹¤¯¤¹¤ë¤¿¤á¡¢
315 ¥ê¥ó¥¯Ì¾¤ÎËöÈø¤Ë¤ÏÂбþ¤¹¤ë¥µ¡¼¥Ó¥¹¤Î̾Á°¤¬¤Ä¤±¤é¤ì¤ë¡£
316 Î㤨¤Ð¡¢
317 .I /etc/rc2.d/S80sendmail
318 ¤È¤¤¤¦¥ê¥ó¥¯¤Ï¡¢sendmail ¥µ¡¼¥Ó¥¹¤ò¥é¥ó¥ì¥Ù¥ë 2 ¤Ë¤ª¤¤¤Æµ¯Æ°¤¹¤ë¡£
319 ¤³¤ì¤Ï¡¢
320 .I /etc/rc2.d/S12syslog
321 ¤è¤ê¤â¸å¤Ë¡¢¤Þ¤¿
322 .I /etc/rc2.d/S90xfs
323 ¤è¤ê¤âÀè¤Ë¼Â¹Ô¤µ¤ì¤ë¡£
324
325 .\"O To manage the boot order and run-levels, we have to manage these links.
326 .\"O However, on many versions of Linux, there are tools to help with this task
327 .\"O (e.g:
328 .\"O .BR chkconfig (8)).
329 ¥Ö¡¼¥È¤Î½ç½ø¤È¥é¥ó¥ì¥Ù¥ë¤ò´ÉÍý¤¹¤ë¤Ë¤Ï¡¢
330 ¤³¤ì¤é¤Î¥ê¥ó¥¯¤ò´ÉÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
331 ¤·¤«¤·Â¿¤¯¤Î Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ç¤Ï¡¢
332 ¤³¤ì¤é¤Îºî¶È¤ò¼ê½õ¤±¤·¤Æ¤¯¤ì¤ë¥Ä¡¼¥ë¤¬Â¸ºß¤¹¤ë
333 (Î㤨¤Ð
334 .BR chkconfig (8)
335 ¤Ê¤É)¡£
336 .\"O .SS "Boot Configuration"
337 .SS ¥Ö¡¼¥È¤ÎÀßÄê
338 .\"O Usually the daemons started may optionally receive command-line options
339 .\"O and parameters.
340 .\"O To allow system administrators to change these
341 .\"O parameters without editing the boot scripts themselves,
342 .\"O configuration files are used.
343 .\"O These are located in a specific
344 .\"O directory (\fI/etc/sysconfig\fR on Red Hat systems) and are
345 .\"O used by the boot scripts.
346 ¥Ç¡¼¥â¥ó¤Îµ¯Æ°»þ¤Ë¤Ï¡¢
347 ¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤ä¥Ñ¥é¥á¡¼¥¿¤ò»ØÄê¤Ç¤­¤ë¤Î¤¬ÉáÄ̤Ǥ¢¤ë¡£
348 ¥·¥¹¥Æ¥à´ÉÍý¼Ô¤¬¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤òÊѹ¹¤·¤¿¤¤¤È»×¤Ã¤¿¤È¤­¤Ë¡¢
349 ¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤½¤Î¤â¤Î¤òÊÔ½¸¤·¤Ê¤¯¤Æ¤â¤¹¤à¤è¤¦¡¢
350 ÀßÄê¥Õ¥¡¥¤¥ë¤¬ÍѤ¤¤é¤ì¤ë¡£¤³¤ì¤é¤ÏÆÃÄê¤Î¥Ç¥£¥ì¥¯¥È¥ê
351 (Red Hat ¥·¥¹¥Æ¥à¤Ç¤Ï
352 .IR /etc/sysconfig )
353 ¤ËÃÖ¤«¤ì¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤«¤é»²¾È¤µ¤ì¤ë¡£
354
355 .\"O In older UNIX systems, these files contained the actual command line
356 .\"O options for the daemons, but in modern Linux systems (and also
357 .\"O in HP-UX), these files just contain shell variables.
358 .\"O The boot scripts in \fI/etc/init.d\fR
359 .\"O \fBsource\fR the configuration
360 .\"O files, and then use the variable values.
361 ¸Å¤¤ UNIX ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï
362 ¥Ç¡¼¥â¥ó¤ËÍ¿¤¨¤ë¼ÂºÝ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤¬½ñ¤«¤ì¤Æ¤¤¤¿¡£
363 ¤·¤«¤·ºÇ¶á¤Î Linux ¥·¥¹¥Æ¥à (¤ä HP-UX) ¤Ç¤Ï¡¢
364 ¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ïñ¤Ë¥·¥§¥ëÊÑ¿ô¤¬½ñ¤«¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£
365 .I /etc/init.d
366 ¤ËÃÖ¤«¤ì¤¿¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤Ï¡¢¤³¤ì¤é¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò
367 .B source
368 ¤·¡¢¤½¤ÎÊÑ¿ô¤ÎÃͤòÍѤ¤¤ë¡£
369 .\"O .SH FILES
370 .SH ¥Õ¥¡¥¤¥ë
371 .\"O .LP
372 .IR /etc/init.d/ ,
373 .\"O .IR /etc/rc[S0\-6].d/ ,
374 .IR /etc/rc[S0\-6].d/ ,
375 .I /etc/sysconfig/
376 .\"O .SH SEE ALSO
377 .SH ´ØÏ¢¹àÌÜ
378 .BR inittab (5),
379 .BR bootparam (7),
380 .BR init (8),
381 .BR runlevel (8),
382 .BR shutdown (8)