/[gentoo]/xml/htdocs/doc/en/handbook/hb-working-rcscripts.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-working-rcscripts.xml

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

Revision 1.11 Revision 1.12
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/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-rcscripts.xml,v 1.11 2004/03/01 05:43:42 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-rcscripts.xml,v 1.12 2004/03/07 12:45:44 swift Exp $ -->
8 8
9<sections> 9<sections>
10<section> 10<section>
11<title>Runlevels</title> 11<title>Runlevels</title>
12<subsection> 12<subsection>
618</p> 618</p>
619 619
620</body> 620</body>
621</subsection> 621</subsection>
622</section> 622</section>
623<section>
624<title>Changing the Runlevel Behaviour</title>
625<subsection>
626<title>Who might benefit from this?</title>
627<body>
628
629<p>
630Many laptop users know the situation: at home you need to start <c>net.eth0</c>
631while you don't want to start <c>net.eth0</c> while you're on the road (as
632there is no network available). With Gentoo you can alter the runlevel behaviour
633to your own will.
634</p>
635
636<p>
637For instance you can create a second "default" runlevel which you can boot that
638has other init scripts assigned to it. You can then select at boottime what
639defalt runlevel you want to use.
640</p>
641
642</body>
643</subsection>
644<subsection>
645<title>Using SOFTLEVEL</title>
646<body>
647
648<p>
649First of all, create the runlevel directory for your second "default" runlevel.
650As an example we create the <path>offline</path> runlevel:
651</p>
652
653<pre caption="Creating a runlevel directory">
654# <i>mkdir /etc/runlevels/offline</i>
655</pre>
656
657<p>
658Add the necessary init scripts to the newly created runlevels. For instance, if
659you want to have an exact copy of your current <c>default</c> runlevel but
660without <c>net.eth0</c>:
661</p>
662
663<pre caption="Adding the necessary init scripts">
664# <i>ls /etc/runlevels/default</i>
665acpid domainname local net.eth0 netmount postfix syslog-ng vcron
666# <i>rc-update add acpid offline</i>
667# <i>rc-update add domainname offline</i>
668# <i>rc-update add local offline</i>
669# <i>rc-update add syslog-ng offline</i>
670# <i>rc-update add vixie-cron offline</i>
671</pre>
672
673<p>
674Now edit your bootloader configuration and add a new entry for the
675<c>offline</c> runlevel. For instance, in <path>/boot/grub/grub.conf</path>:
676</p>
677
678<pre caption="Adding an entry for the offline runlevel">
679title Gentoo Linux Offline Usage
680 root (hd0,0)
681 kernel (hd0,0)/kernel-2.4.25 root=/dev/hda3 <i>softlevel=offline</i>
682</pre>
683
684<p>
685Voila, you're all set now. If you boot your system and select the newly added
686entry at boot, the <c>offline</c> runlevel will be used instead of the
687<c>default</c> one.
688</p>
689
690</body>
691</subsection>
692<subsection>
693<title>Using BOOTLEVEL</title>
694<body>
695
696<p>
697Using <c>bootlevel</c> is completely analogous to <c>softlevel</c>. The only
698difference here is that you define a second "boot" runlevel instead of a second
699"default" runlevel.
700</p>
701
702</body>
703</subsection>
704</section>
623</sections> 705</sections>

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

  ViewVC Help
Powered by ViewVC 1.1.20