/[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.35 Revision 1.36
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.35 2011/08/17 07:57:23 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-rcscripts.xml,v 1.36 2011/09/17 12:45:11 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract> 11<abstract>
12Gentoo uses a special initscript format which, amongst other features, allows 12Gentoo uses a special initscript format which, amongst other features, allows
13dependency-driven decisions and virtual initscripts. This chapter explains all 13dependency-driven decisions and virtual initscripts. This chapter explains all
14these aspects and explains how to deal with these scripts. 14these aspects and explains how to deal with these scripts.
15</abstract> 15</abstract>
16 16
17<version>4</version> 17<version>5</version>
18<date>2011-08-17</date> 18<date>2011-09-17</date>
19 19
20<section> 20<section>
21<title>Runlevels</title> 21<title>Runlevels</title>
22<subsection> 22<subsection>
23<title>Booting your System</title> 23<title>Booting your System</title>
717<title>Adding Custom Options</title> 717<title>Adding Custom Options</title>
718<body> 718<body>
719 719
720<p> 720<p>
721If you want your init script to support more options than the ones we have 721If you want your init script to support more options than the ones we have
722already encountered, you should add the option to the <c>opts</c> variable, and 722already encountered, you should add the option to the <c>extra_commands</c>
723create a function with the same name as the option. For instance, to support an 723variable, and create a function with the same name as the option. For instance,
724option called <c>restartdelay</c>: 724to support an option called <c>restartdelay</c>:
725</p> 725</p>
726 726
727<pre caption="Supporting the restartdelay option"> 727<pre caption="Supporting the restartdelay option">
728opts="${opts} restartdelay" 728extra_commands="restartdelay"
729 729
730restartdelay() { 730restartdelay() {
731 stop 731 stop
732 sleep 3 <comment># Wait 3 seconds before starting again</comment> 732 sleep 3 <comment># Wait 3 seconds before starting again</comment>
733 start 733 start

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.20