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>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libbrand/dtd/brand.dtd.1
          +++ new/usr/src/lib/libbrand/dtd/brand.dtd.1
↓ open down ↓ 204 lines elided ↑ open up ↑
 205  205  
 206  206      Path to the initial executable that should be launched when booting a
 207  207      branded zone.
 208  208  
 209  209      It has no attributes.
 210  210  -->
 211  211  <!ELEMENT initname      (#PCDATA) >
 212  212  <!ATTLIST initname>
 213  213  
 214  214  <!--
 215      -  restartinit
      215 +  restartinit, restartinit0 and restartinitreboot
 216  216  
 217      -    Boolean indicating that the program specified by the initname attr
 218      -    should be restarted, or not, if it exits.  By default, the init program
 219      -    will be restarted if this attribute is not provided.  Specifying false
 220      -    for this attr will prevent that.
      217 +    These three boolean elements control what action is taken when the
      218 +    program specified by the 'initname' element exits.
 221  219  
 222      -    It has no attributes.
      220 +    The default values are:
      221 +
      222 +        restartinit:       true
      223 +        restartinit0:      false
      224 +        restartinitreboot: false
      225 +
      226 +    If 'restartinit' is set to false then the init process will never be
      227 +    restarted and the zone will shut down once init exits. In this case, the
      228 +    other restartinit elements are ignored.
      229 +
      230 +    When 'restartinit0' is set, init will only be restarted if it exited with
      231 +    an exit status of 0, otherwise the zone will shut down.
      232 +
      233 +    If 'restartinitreboot' is set to true then whenever init should be
      234 +    restarted, based on the other restartinit elements, the zone will instead
      235 +    be rebooted.
      236 +
      237 +    These have no attributes.
 223  238  -->
 224  239  <!ELEMENT restartinit   (#PCDATA) >
 225  240  <!ATTLIST restartinit>
      241 +<!ELEMENT restartinit0  (#PCDATA) >
      242 +<!ATTLIST restartinit0>
      243 +<!ELEMENT restartinitreboot     (#PCDATA) >
      244 +<!ATTLIST restartinitreboot>
 226  245  
 227  246  <!--
 228  247    login_cmd
 229  248  
 230  249      Path to the initial login binary that should be executed when
 231  250      attempting to zlogin into a branded zone.
 232  251  
 233  252      The following replacements are performed:
 234  253  
 235  254        %Z        Name of the current zone
↓ open down ↓ 384 lines elided ↑ open up ↑
 620  639        set       The name of the set the privilege should go into.
 621  640        name      The name of the privilege.
 622  641        ip-type   Optional, indicates that adding of the privilege to the
 623  642                  set only applies to certain IP types. Can be "shared" or
 624  643                  "exclusive". If it is not specified, the default value
 625  644                  "all" will be used, which means it is applicable regardless
 626  645                  the IP type.
 627  646  
 628  647  -->
 629  648  <!ELEMENT privilege     (#PCDATA) >
 630      -<!ATTLIST privilege     set     ( default | prohibited | required ) #REQUIRED 
      649 +<!ATTLIST privilege     set     ( default | prohibited | required ) #REQUIRED
 631  650                          name    CDATA #REQUIRED
 632  651                          ip-type ( shared | exclusive ) "all" >
 633  652  
 634  653  <!--
 635  654    brand
 636  655  
 637  656      The toplevel container for a brand configuration.
 638  657  
 639  658      Its attributes are
 640  659  
 641  660        name      The name of the brand.  This must match the name of the
 642  661                  directory in which the configuration file is stored.
 643  662  -->
 644  663  
 645      -<!ELEMENT brand         (modname?, initname, restartinit?, login_cmd,
      664 +<!ELEMENT brand         (modname?, initname, restartinit?,
      665 +                        restartinit0?, restartinitreboot?,
      666 +                        login_cmd,
 646  667                          forcedlogin_cmd, user_cmd, install,
 647  668                          installopts?, boot?, sysboot?, halt?, shutdown?,
 648  669                          verify_cfg?, verify_adm?, postattach?, postclone?,
 649  670                          postinstall?, predetach?, attach?, detach?, clone?,
 650  671                          presnap?, postsnap?, validatesnap?,
 651  672                          preuninstall?, uninstall?,
 652  673                          prestatechange?, poststatechange?, query?,
 653  674                          privilege+)>
 654  675  
 655  676  <!ATTLIST brand         name            CDATA #REQUIRED>
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX