/[gentoo]/xml/htdocs/doc/en/openrc-migration.xml
Gentoo

Diff of /xml/htdocs/doc/en/openrc-migration.xml

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

Revision 1.11 Revision 1.22
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/openrc-migration.xml,v 1.11 2008/09/11 08:29:05 nightmorph Exp $ --> 3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/openrc-migration.xml,v 1.22 2011/01/13 03:39:04 robbat2 Exp $ -->
4 4
5<guide link="/doc/en/openrc-migration.xml"> 5<guide link="/doc/en/openrc-migration.xml">
6<title>Baselayout and OpenRC Migration Guide</title> 6<title>Baselayout and OpenRC Migration Guide</title>
7 7
8<author title="Author"> 8<author title="Author">
9 <mail link="cardoe"/> 9 <mail link="cardoe"/>
10</author> 10</author>
11<author title="Author"> 11<author title="Author">
12 <mail link="nightmorph"/> 12 <mail link="nightmorph"/>
13</author> 13</author>
14<author title="Author">
15 <mail link="robbat2"/>
16</author>
14<author title="Contributor"> 17<author title="Contributor">
15 <mail link="uberlord"/> 18 <mail link="uberlord"/>
16</author> 19</author>
17 20
18<abstract> 21<abstract>
22 25
23<!-- The content of this document is licensed under the CC-BY-SA license --> 26<!-- The content of this document is licensed under the CC-BY-SA license -->
24<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 27<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
25<license/> 28<license/>
26 29
27<version>1.7</version> 30<version>4</version>
28<date>2008-09-11</date> 31<date>2011-01-12</date>
29 32
30<chapter> 33<chapter>
31<title>Background</title> 34<title>Background</title>
35
36<!-- =============================================================== -->
32<section> 37<section>
33<title>What's baselayout?</title> 38<title>What's baselayout?</title>
34<body> 39<body>
35 40
36<p> 41<p>
40<path>/usr</path>, <path>/home</path> directories). 45<path>/usr</path>, <path>/home</path> directories).
41</p> 46</p>
42 47
43</body> 48</body>
44</section> 49</section>
50<!-- =============================================================== -->
51
45<section> 52<section>
46<title>What's OpenRC?</title> 53<title>What's OpenRC?</title>
47<body> 54<body>
48 55
49<p> 56<p>
51by the system, normally <path>/sbin/init</path>. However, it is <e>not</e> a 58by the system, normally <path>/sbin/init</path>. However, it is <e>not</e> a
52replacement for <path>/sbin/init</path>. The default init used by Gentoo Linux 59replacement for <path>/sbin/init</path>. The default init used by Gentoo Linux
53is <c>sys-apps/sysvinit</c>, while Gentoo/FreeBSD uses the FreeBSD init provided 60is <c>sys-apps/sysvinit</c>, while Gentoo/FreeBSD uses the FreeBSD init provided
54by <c>sys-freebsd/freebsd-sbin</c>. 61by <c>sys-freebsd/freebsd-sbin</c>.
55</p> 62</p>
63
56</body> 64</body>
57</section> 65</section>
66<!-- =============================================================== -->
67
58<section> 68<section>
59<title>So why migrate?</title> 69<title>So why migrate?</title>
60<body> 70<body>
61 71
62<p> 72<p>
83FreeBSD and NetBSD. 93FreeBSD and NetBSD.
84</p> 94</p>
85 95
86</body> 96</body>
87</section> 97</section>
98<!-- =============================================================== -->
99
88</chapter> 100</chapter>
89
90<chapter> 101<chapter>
91<title>Migration to OpenRC</title> 102<title>Migration to OpenRC</title>
103
104<!-- =============================================================== -->
92<section> 105<section>
93<body> 106<body>
94 107
95<p> 108<p>
96Migration to OpenRC is fairly straightforward; it will be pulled in as part of 109Migration to OpenRC is fairly straightforward; it will be pulled in as part of
108verify prior to rebooting. 121verify prior to rebooting.
109</p> 122</p>
110 123
111</body> 124</body>
112</section> 125</section>
126<!-- =============================================================== -->
113 127
114<section id="rc_conf"> 128<section id="rc_conf">
115<title>/etc/conf.d/rc</title> 129<title>/etc/conf.d/rc</title>
116<body> 130<body>
117 131
123delete <path>/etc/conf.d/rc</path>. 137delete <path>/etc/conf.d/rc</path>.
124</p> 138</p>
125 139
126</body> 140</body>
127</section> 141</section>
142<!-- =============================================================== -->
143
128<section id="modules"> 144<section id="modules">
129<title>Kernel modules</title> 145<title>Kernel modules</title>
130<body> 146<body>
131 147
132<p> 148<p>
161In the above examples, the modules and their parameters would only be passed 177In the above examples, the modules and their parameters would only be passed
162to 2.6.x series kernels. The new configuration allows for fine grained 178to 2.6.x series kernels. The new configuration allows for fine grained
163control over the modules and parameters based on kernel version. 179control over the modules and parameters based on kernel version.
164</p> 180</p>
165 181
182<impo>
183The <b>module*</b> variables are not cumulative. The more version-specific
184variables will override the more general variables.
185</impo>
186
187<note>
188Please note the difference between <b>module_</b> and <b>modules_</b>.
189</note>
190
166<p> 191<p>
167An in-depth example would be: 192An in-depth example would be:
168</p> 193</p>
169 194
170<pre caption="detailed example of /etc/conf.d/modules"> 195<pre caption="detailed example of /etc/conf.d/modules">
171<comment># Always load ochi1394 and ieee1394, no matter the kernel version</comment>
172modules="ohci1394 ieee1394"
173<comment># Only load tun and usbserial for 2.6.x series kernels</comment>
174modules_2_6="tun usbserial"
175<comment># Only load cx88_dvb for 2.6.23 kernels</comment>
176modules_2_6_23="cx88_dvb"
177<comment># Only load ivtv for 2.6.23-gentoo-r5</comment> 196<comment># Only load ivtv for 2.6.23-gentoo-r5</comment>
178modules_2_6_23_gentoo_r5="ivtv" 197modules_2_6_23_gentoo_r5="ivtv"
198<comment># Only load cx88_dvb for 2.6.23 kernels (other than -gentoo-r5)</comment>
199modules_2_6_23="cx88_dvb"
200<comment># Only load tun and usbserial for 2.6.x series kernels where x != 23</comment>
201modules_2_6="tun usbserial"
202<comment># Otherwise load ochi1394 and ieee1394</comment>
203modules="ohci1394 ieee1394"
179 204
180<comment># For 2.6.23-gentoo-r5, pass video_br=2 to cx88_dvb</comment> 205<comment># For 2.6.23-gentoo-r5, pass video_br=2 to cx88_dvb</comment>
181module_cx88_dvb_args_2_6_23_gentoo_r5="video_br=2" 206module_cx88_dvb_args_2_6_23_gentoo_r5="video_br=2"
182<comment># For 2.6.x series kernels, always pass vendor and product</comment> 207<comment># For 2.6.x series kernels, always pass vendor and product</comment>
183module_usbserial_args_2_6="vendor=0x1410 product=0x2110" 208module_usbserial_args_2_6="vendor=0x1410 product=0x2110"
184<comment># Always pass debug to ieee1394</comment> 209<comment># Always pass debug to ieee1394</comment>
185module_ieee1394_args="debug" 210module_ieee1394_args="debug"
186</pre> 211</pre>
187 212
188<note>
189Please note the difference between <b>module_</b> and <b>modules_</b>.
190</note>
191
192</body> 213</body>
193</section> 214</section>
215
216<!-- =============================================================== -->
194<section id="boot"> 217<section id="boot">
195<title>Boot runlevel</title> 218<title>Boot runlevel</title>
196<body> 219<body>
197 220
198<p> 221<p>
235<p> 258<p>
236If you know you use mdraid and lvm but do not see them above, you would run 259If you know you use mdraid and lvm but do not see them above, you would run
237the following to add initscripts to the <c>boot</c> runlevel: 260the following to add initscripts to the <c>boot</c> runlevel:
238</p> 261</p>
239 262
240<pre caption="Adding raid and lvm to the boot runlevel"> 263<pre caption="Adding mdraid and lvm to the boot runlevel">
241# <i>rc-update add raid boot</i> 264# <i>rc-update add mdraid boot</i>
242# <i>rc-update add lvm boot</i> 265# <i>rc-update add lvm boot</i>
243</pre> 266</pre>
244 267
245</body> 268</body>
246</section> 269</section>
270<!-- =============================================================== -->
271
272<section>
273<title>Udev</title>
274<body>
275
276<p>
277OpenRC no longer starts <c>udev</c> by default, but it does need to be present
278in the <c>sysinit</c> runlevel to be started. The OpenRC ebuild should detect if
279<c>udev</c> was previously enabled and add it to the <c>sysinit</c> runlevel.
280However, to be safe, check if <c>udev</c> is present:
281</p>
282
283<pre caption="Verifying udev">
284# <i>ls -l /etc/runlevels/sysinit</i>
285lrwxrwxrwx 1 root root 14 2009-01-29 08:00 /etc/runlevels/sysinit/udev -> \
286/etc/init.d/udev
287</pre>
288
289<p>
290If <c>udev</c> is not listed, add it to the correct runlevel:
291</p>
292
293<pre caption="Adding udev to the sysinit runlevel">
294# <i>rc-update add udev sysinit</i>
295</pre>
296
297</body>
298</section>
299<!-- =============================================================== -->
300
247<section> 301<section>
248<title>Network</title> 302<title>Network</title>
249<body> 303<body>
250 304
251<p> 305<p>
264to re-add them. Simply replace <c>eth0</c> with the name of your network 318to re-add them. Simply replace <c>eth0</c> with the name of your network
265device. 319device.
266</p> 320</p>
267 321
268<p> 322<p>
269Also, <path>/etc/conf.d/net</path> no longer uses bash-style arrays for 323Also, <path>/etc/conf.d/net</path> (oldnet) no longer uses bash-style arrays
270configuration. Please review <path>/usr/share/doc/openrc/net.example</path> for 324for configuration. Please review
325<path>/usr/share/doc/openrc-&lt;version&gt;/net.example</path> for configuration
271configuration instructions. Conversion should be relatively straight-forward, 326instructions. Conversion should be relatively straight-forward, converting to
272for example a static IP assignment would change as follows: 327newlines for seperate entries, for example a static IP assignment would change
328as follows:
273</p> 329</p>
274 330
275<pre caption="Old /etc/conf.d/net style"> 331<pre caption="Old /etc/conf.d/net style">
276config_eth0=( "192.168.1.37 netmask 255.255.255.0 brd 192.168.1.255" ) 332config_eth0=( "192.168.1.37 netmask 255.255.255.0 brd 192.168.1.255" )
277routes_eth0=( "default via 192.168.1.100" ) 333routes_eth0=( "default via 192.168.1.100" "10.0.0.0/8 via 192.168.1.2" )
278</pre> 334</pre>
279 335
280<pre caption="New /etc/conf.d/net style"> 336<pre caption="New /etc/conf.d/net style">
281config_eth0="192.168.1.37 netmask 255.255.255.0 brd 192.168.1.255" 337config_eth0="192.168.1.37 netmask 255.255.255.0 brd 192.168.1.255"
282routes_eth0="default via 192.168.1.100" 338routes_eth0="default via 192.168.1.100
33910.0.0.0/8 via 192.168.1.2"
283</pre> 340</pre>
284 341
285</body> 342</body>
286</section> 343</section>
344<!-- =============================================================== -->
345
287<section> 346<section>
288<title>Clock</title> 347<title>Clock</title>
289<body> 348<body>
290 349
291<p> 350<p>
292Clock settings have been renamed from <path>/etc/conf.d/clock</path> to your 351Clock settings have been renamed from <path>/etc/conf.d/clock</path> to your
293system's native tool for adjusting the clock. This means on Linux it will be 352system's native tool for adjusting the clock. This means on Linux it will be
294<path>/etc/conf.d/hwclock</path> and on FreeBSD it will be 353<path>/etc/conf.d/hwclock</path> and on FreeBSD it will be
295<path>/etc/conf.d/adjkerntz</path>. The initscript in <path>/etc/init.d/</path> 354<path>/etc/conf.d/adjkerntz</path>. Systems without a working real time clock
296has also been renamed accordingly, so make sure it's in the appropriate 355(RTC) chip should use <path>/etc/init.d/swclock</path>, which sets the system
356time based on the mtime of a file which is created at system shutdown. The
357initscripts in <path>/etc/init.d/</path> have also been renamed accordingly, so
358make sure the appropriate script for your system has been added to the boot
297runlevel. 359runlevel.
298</p> 360</p>
299 361
300<p> 362<p>
301Additionally, the <c>TIMEZONE</c> variable is no longer in this file. Its 363Additionally, the <c>TIMEZONE</c> variable is no longer in this file. Its
314America/New_York 376America/New_York
315</pre> 377</pre>
316 378
317</body> 379</body>
318</section> 380</section>
381<!-- =============================================================== -->
382
319<section> 383<section>
320<title>XSESSION</title> 384<title>XSESSION</title>
321<body> 385<body>
322 386
323<p> 387<p>
324The XSESSION variable is no longer found in <path>/etc/rc.conf</path>. The 388The XSESSION variable is no longer found in <path>/etc/rc.conf</path>. Instead,
325<c>x11-apps/xinit</c> package now provides <path>/etc/env.d/90xsession</path>, 389you can set the XSESSION variable per-user in <path>~/.bashrc</path> (or
326which can be used to set the XSESSION variable. 390equivalent), or system-wide in <path>/etc/env.d/</path>.
327</p>
328
329<p> 391</p>
330This variable will <b>NOT</b> be migrated for you by default, so you will need 392
331to edit <path>/etc/env.d/90xsession</path>.
332</p> 393<p>
333 394Here's an example of setting XSESSION for the whole system:
334<impo>
335You must run <c>env-update</c> after creating a file in <path>/etc/env.d</path>,
336and then logout and login for it to take effect.
337</impo>
338
339</body>
340</section>
341<section>
342<title>EDITOR / PAGER</title>
343<body>
344
345<p> 395</p>
346The EDITOR variable is no longer found in <path>/etc/rc.conf</path>. Both 396
347EDITOR and PAGER are set by default in /etc/profile. You should change this as 397<pre caption="Setting XSESSION system-wide">
348needed in your <path>~/.bashrc</path> (or equivalent) file or create 398# <i>echo 'XSESSION="Xfce4"' > /etc/env.d/90xsession</i>
349<path>/etc/env.d/99editor</path> and set the system default there.
350</p> 399</pre>
351 400
352<impo> 401<impo>
353You must run <c>env-update</c> after creating a file in <path>/etc/env.d</path>, 402You must run <c>env-update</c> after creating a file in <path>/etc/env.d</path>,
354and then logout and login for it to take effect. If you set the variable in 403and then logout and login for it to take effect. If you set the variable in
355<path>~/.bashrc</path>, you can re-source the file with <c>source 404<path>~/.bashrc</path>, you can re-source the file with <c>source
356~/.bashrc</c>. 405~/.bashrc</c>.
357</impo> 406</impo>
358 407
359</body> 408</body>
360</section> 409</section>
410<!-- =============================================================== -->
411
412<section>
413<title>EDITOR and PAGER</title>
414<body>
415
416<p>
417The EDITOR variable is no longer found in <path>/etc/rc.conf</path>. Both
418EDITOR and PAGER are set by default in <path>/etc/profile</path>. You should
419change this as needed in your <path>~/.bashrc</path> (or equivalent) file or
420create <path>/etc/env.d/99editor</path> and set the system default there.
421</p>
422
423<impo>
424You must run <c>env-update</c> after creating a file in <path>/etc/env.d</path>,
425and then logout and login for it to take effect. If you set the variable in
426<path>~/.bashrc</path>, you can re-source the file with <c>source
427~/.bashrc</c>.
428</impo>
429
430</body>
431</section>
432<!-- =============================================================== -->
433
361<section> 434<section>
362<title>Boot log</title> 435<title>Boot log</title>
363<body> 436<body>
364 437
365<p> 438<p>
375rc_logger="YES" 448rc_logger="YES"
376</pre> 449</pre>
377 450
378</body> 451</body>
379</section> 452</section>
453<!-- =============================================================== -->
454
380<section> 455<section>
381<title>Finishing up</title> 456<title>Finishing up</title>
382<body> 457<body>
383 458
384<p> 459<p>
388boot. 463boot.
389</p> 464</p>
390 465
391</body> 466</body>
392</section> 467</section>
468<!-- =============================================================== -->
469
470</chapter>
471<chapter>
472<title>Changed functionality</title>
473<!-- =============================================================== -->
474
475<section>
476<title>The pause action</title>
477<body>
478
479<p>
480Previously it was possible to temporarily stop a service without taking down all
481the depending services by using <c>/etc/init.d/service pause</c>. In OpenRC, the
482<c>pause</c> action was removed; this functionality is supported by the
483<c>/etc/init.d/service --nodeps stop</c>, which also works in the old
484baselayout.
485</p>
486
487</body>
488</section>
489<!-- =============================================================== -->
490
393</chapter> 491</chapter>
394</guide> 492</guide>

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20