| … | |
… | |
| 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-working-rcscripts.xml,v 1.33 2011/08/12 19:34:56 swift Exp $ --> |
7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-rcscripts.xml,v 1.34 2011/08/14 16:12:13 swift Exp $ --> |
| 8 | |
8 | |
| 9 | <sections> |
9 | <sections> |
| 10 | |
10 | |
| 11 | <abstract> |
11 | <abstract> |
| 12 | Gentoo uses a special initscript format which, amongst other features, allows |
12 | Gentoo uses a special initscript format which, amongst other features, allows |
| … | |
… | |
| 776 | net.eth0 | |
776 | net.eth0 | |
| 777 | </pre> |
777 | </pre> |
| 778 | |
778 | |
| 779 | <p> |
779 | <p> |
| 780 | Even though <c>net.eth0</c> has been removed from the offline runlevel, |
780 | Even though <c>net.eth0</c> has been removed from the offline runlevel, |
| 781 | <c>udev</c> will still attempt to start any devices it detects and launch the |
781 | <c>udev</c> might want to attempt to start any devices it detects and launch the |
| 782 | appropriate services. Therefore, you will need to add each network service you |
782 | appropriate services, a functionality that is called <e>hotplugging</e>. By |
| 783 | do not want started (as well as services for any other devices that may be |
783 | default, Gentoo does not enable hotplugging. |
| 784 | started by udev) to <path>/etc/conf.d/rc</path> as shown. |
784 | </p> |
|
|
785 | |
| 785 | </p> |
786 | <p> |
|
|
787 | If you do want to enable hotplugging, but only for a selected set of scripts, |
|
|
788 | use the <c>rc_hotplug</c> variable in <path>/etc/rc.conf</path>: |
|
|
789 | </p> |
| 786 | |
790 | |
| 787 | <pre caption="Disabling device initiated services in /etc/conf.d/rc"> |
791 | <pre caption="Disabling device initiated services in /etc/rc.conf"> |
| 788 | RC_COLDPLUG="yes" |
792 | <comment># Allow net.wlan as well as any other service, except those matching net.* |
| 789 | <comment>(Next, specify the services you do not want automatically started)</comment> |
793 | # to be hotplugged</comment> |
| 790 | RC_PLUG_SERVICES="!net.eth0" |
794 | rc_hotplug="net.wlan !net.*" |
| 791 | </pre> |
795 | </pre> |
| 792 | |
796 | |
| 793 | <note> |
797 | <note> |
| 794 | For more information on device initiated services, please see the comments |
798 | For more information on device initiated services, please see the comments |
| 795 | inside <path>/etc/conf.d/rc</path>. |
799 | inside <path>/etc/rc.conf</path>. |
| 796 | </note> |
800 | </note> |
| 797 | |
801 | |
| 798 | <p> |
802 | <p> |
| 799 | Now edit your bootloader configuration and add a new entry for the |
803 | Now edit your bootloader configuration and add a new entry for the |
| 800 | <c>offline</c> runlevel. For instance, in <path>/boot/grub/grub.conf</path>: |
804 | <c>offline</c> runlevel. For instance, in <path>/boot/grub/grub.conf</path>: |