/[gentoo]/xml/htdocs/doc/en/handbook/hb-net-advanced.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-net-advanced.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.15 Revision 1.16
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-advanced.xml,v 1.15 2009/02/13 04:40:27 nightmorph Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-advanced.xml,v 1.16 2011/08/14 16:12:13 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract> 11<abstract>
12Here we learn about how the configuration works - you need to know this 12Here we learn about how the configuration works - you need to know this
13before we learn about modular networking. 13before we learn about modular networking.
14</abstract> 14</abstract>
15 15
16<version>8.1</version> 16<version>9</version>
17<date>2009-02-12</date> 17<date>2011-08-13</date>
18 18
19<section> 19<section>
20<title>Advanced Configuration</title> 20<title>Advanced Configuration</title>
21<body> 21<body>
22 22
126<title>Network Dependencies</title> 126<title>Network Dependencies</title>
127<body> 127<body>
128 128
129<p> 129<p>
130Init scripts in <path>/etc/init.d</path> can depend on a specific network 130Init scripts in <path>/etc/init.d</path> can depend on a specific network
131interface or just net. <c>net</c> can be defined in <path>/etc/conf.d/rc</path> 131interface or just net. All network interfaces in Gentoo's init system provide
132to mean different things using the <c>RC_NET_STRICT_CHECKING</c> variable. 132what is called <e>net</e>.
133</p>
134
133</p> 135<p>
136If, in <path>/etc/rc.conf</path>, <c>rc_depend_strict="YES"</c> is set, then all
137network interfaces that provide net must be active before a dependency on "net"
138is assumed to be met. In other words, if you have a <path>net.eth0</path> and
139<path>net.eth1</path> and an init script depends on "net", then both must be
140enabled.
141</p>
134 142
135<table> 143<p>
136<tr> 144On the other hand, if <c>rc_depend_strict="NO"</c> is set, then the "net"
137 <th>Value</th> 145dependency is marked as resolved the moment at least one network interface is
138 <th>Description</th> 146brought up.
139</tr> 147</p>
140<tr>
141 <ti><c>none</c></ti>
142 <ti>The <path>net</path> service is always considered up</ti>
143</tr>
144<tr>
145 <ti><c>no</c></ti>
146 <ti>
147 This basically means that at least one <path>net.*</path> service besides
148 <path>net.lo</path> must be up. This can be used by notebook users that
149 have a WIFI and a static NIC, and only wants one up at any given time to
150 have the net service seen as up.
151 </ti>
152</tr>
153<tr>
154 <ti><c>lo</c></ti>
155 <ti>
156 This is the same as the <c>no</c> option, but <path>net.lo</path> is also
157 counted. This should be useful to people that do not care about any specific
158 interface being up at boot.
159 </ti>
160</tr>
161<tr>
162 <ti><c>yes</c></ti>
163 <ti>
164 For this ALL network interfaces MUST be up for the <path>net</path> service
165 to be considered up.
166 </ti>
167</tr>
168</table>
169 148
170<p> 149<p>
171But what about <path>net.br0</path> depending on <path>net.eth0</path> and 150But what about <path>net.br0</path> depending on <path>net.eth0</path> and
172<path>net.eth1</path>? <path>net.eth1</path> may be a wireless or PPP device 151<path>net.eth1</path>? <path>net.eth1</path> may be a wireless or PPP device
173that needs configuration before it can be added to the bridge. This cannot be 152that needs configuration before it can be added to the bridge. This cannot be
174done in <path>/etc/init.d/net.br0</path> as that's a symbolic link to 153done in <path>/etc/init.d/net.br0</path> as that's a symbolic link to
175<path>net.lo</path>. 154<path>net.lo</path>.
176</p> 155</p>
177 156
178<p> 157<p>
179The answer is making your own <c>depend()</c> function in 158The answer is defining an <c>rc_need_</c> setting in
180<path>/etc/conf.d/net</path>. 159<path>/etc/conf.d/net</path>.
181</p> 160</p>
182 161
183<pre caption="net.br0 dependency in /etc/conf.d/net"> 162<pre caption="net.br0 dependency in /etc/conf.d/net">
184<comment># You can use any dependency (use, after, before) as found in current scripts</comment>
185depend_br0() {
186 need net.eth0 net.eth1 163rc_need_br0="net.eth0 net.eth1"
187}
188</pre> 164</pre>
189 165
190<p> 166<p>
191For a more detailed discussion about dependency, consult the section <uri 167For a more detailed discussion about dependency, consult the section <uri
192link="?part=2&amp;chap=4#doc_chap4">Writing Init Scripts</uri> in the Gentoo 168link="?part=2&amp;chap=4#doc_chap4">Writing Init Scripts</uri> in the Gentoo
193Handbook. 169Handbook. More information about <path>/etc/rc.conf</path> is available as
170comments within that file.
194</p> 171</p>
195 172
196</body> 173</body>
197</section> 174</section>
198 175

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20