Add Herbert Pƶtzl's patch to support initialization scriptlets.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 12 Sep 2006 17:17:03 +0000 (17:17 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 12 Sep 2006 17:17:03 +0000 (17:17 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2308 94cd875c-1c1d-0410-91d2-eb244daf1a30

doc/configuration.xml
scripts/vserver.start

index 323aaee..9cd95f5 100644 (file)
@@ -770,6 +770,57 @@ environment variable must be set by one of the in-shellcontext scripts
 (the non-executable ones).
       </description>
       
+      <program name="initialize">
+       <description>
+The scriptlet which will be executed before the root filesystem is mounted and
+the configuration has been loaded. Before executing the script, the
+configuration directory will be made the working directory.
+        </description>
+       <parameterList>
+         <parameter name="vserver-dir">
+           <description>
+The configuration directory of the current vserver.
+            </description>
+         </parameter>
+         <parameter name="vserver-name">
+           <description>
+The name of the current vserver.
+            </description>
+         </parameter>
+         <parameter name="action">
+           <description>
+The fixed value of the current action (e.g. 'prepre-start', 'post-stop'...).
+            </description>
+         </parameter>
+       </parameterList>
+      </program>
+      <collection name="initialize.d">
+       <description>
+Repository of initialize like scripts.  Before executing the script,
+the configuration directory will be made the working directory.
+        </description>                                                                                                                 
+       <program name="script" type="symbolic">
+         <description>See initialize.</description>
+         <parameterList>
+           <parameter name="vserver-dir">
+             <description>
+The configuration directory of the current vserver.
+              </description>
+           </parameter>
+           <parameter name="vserver-name">
+             <description>
+The name of the current vserver.
+              </description>
+           </parameter>
+           <parameter name="action">
+             <description>
+The fixed value of the current action (e.g. 'prepre-start', 'post-stop'...).
+              </description>
+           </parameter>
+         </parameterList>
+       </program>
+      </collection>
+      
       <program name="prepre-start">
        <description>
 The scriptlet which will be executed before the network-interfaces are
index 98a07cd..4230614 100644 (file)
@@ -100,6 +100,10 @@ trap "cleanup" EXIT
 
 sanityCheck      "$VSERVER_DIR"
 
+pushd "$VSERVER_DIR" >/dev/null
+execScriptlets   "$VSERVER_DIR" "$VSERVER_NAME" initialize
+popd >/dev/null
+
 mountRootFS      "$VSERVER_DIR"
 generateOptions  "$VSERVER_DIR"