Print this page
14019 Allow more control over zone init exit actions
Portions contributed by: Joshua M. Clulow <jmc@joyent.com>
Portions contributed by: Andy Fiddaman <andy@omnios.org>
Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com>
Approved by: Robert Mustacchi <rm@fingolfin.org>

@@ -190,20 +190,37 @@
 
     It has no attributes.  --> <!ELEMENT initname (#PCDATA) > <!ATTLIST
 initname>
 
 <!--
-  restartinit
+  restartinit, restartinit0 and restartinitreboot
 
-    Boolean indicating that the program specified by the initname attr
-    should be restarted, or not, if it exits.  By default, the init program
-    will be restarted if this attribute is not provided.  Specifying false
-    for this attr will prevent that.
+    These three boolean elements control what action is taken when the
+    program specified by the 'initname' element exits.
 
-    It has no attributes.  --> <!ELEMENT restartinit   (#PCDATA) > <!ATTLIST
-restartinit>
+    The default values are:
 
+        restartinit:       true
+        restartinit0:      false
+        restartinitreboot: false
+
+    If 'restartinit' is set to false then the init process will never be
+    restarted and the zone will shut down once init exits. In this case, the
+    other restartinit elements are ignored.
+
+    When 'restartinit0' is set, init will only be restarted if it exited with
+    an exit status of 0, otherwise the zone will shut down.
+
+    If 'restartinitreboot' is set to true then whenever init should be
+    restarted, based on the other restartinit elements, the zone will instead
+    be rebooted.
+
+    These have no attributes.  --> <!ELEMENT restartinit    (#PCDATA) >
+<!ATTLIST restartinit> <!ELEMENT restartinit0     (#PCDATA) > <!ATTLIST
+restartinit0> <!ELEMENT restartinitreboot    (#PCDATA) > <!ATTLIST
+restartinitreboot>
+
 <!--
   login_cmd
 
     Path to the initial login binary that should be executed when
     attempting to zlogin into a branded zone.

@@ -572,11 +589,12 @@
     Its attributes are
 
       name     The name of the brand.  This must match the name of the
           directory in which the configuration file is stored.  -->
 
-<!ELEMENT brand          (modname?, initname, restartinit?, login_cmd,
+<!ELEMENT brand          (modname?, initname, restartinit?,
+               restartinit0?, restartinitreboot?,                login_cmd,
                forcedlogin_cmd, user_cmd, install,               installopts?,
 boot?, sysboot?, halt?, shutdown?,                verify_cfg?, verify_adm?,
 postattach?, postclone?,                postinstall?, predetach?, attach?,
 detach?, clone?,              presnap?, postsnap?, validatesnap?,
                preuninstall?, uninstall?,              prestatechange?,