Print this page
Bring back LX zones.


  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 #
  23 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24 
  25 . /lib/svc/share/smf_include.sh
  26 
  27 #
  28 # Return a list of running, non-global zones for which a shutdown via
  29 # "/sbin/init 0" may work (typically only Solaris zones.)
  30 #
  31 shutdown_zones()
  32 {
  33         zoneadm list -p | nawk -F: '{
  34                 if ($2 != "global") {
  35                         print $2
  36                 }
  37         }'
  38 }
  39 
  40 [ ! -x /usr/sbin/zoneadm ] && exit 0    # SUNWzoneu not installed
  41 
  42 if [ -z "$SMF_FMRI" ]; then
  43         echo "this script can only be invoked by smf(5)"        
  44         exit $SMF_EXIT_ERR_NOSMF
  45 fi
  46 
  47 # Make sure working directory is / to prevent unmounting problems.
  48 cd /
  49 PATH=/usr/sbin:/usr/bin; export PATH
  50 
  51 case "$1" in
  52 'start')
  53         egrep -vs '^#|^global:' /etc/zones/index || exit 0  # no local zones
  54 




  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 #
  23 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24 
  25 . /lib/svc/share/smf_include.sh
  26 
  27 #
  28 # Return a list of running, non-global zones for which a shutdown via
  29 # "/sbin/init 0" may work (typically only Solaris zones.)
  30 #
  31 shutdown_zones()
  32 {
  33         zoneadm list -p | nawk -F: '{
  34                 if (($5 != "lx") && ($2 != "global")) {
  35                         print $2
  36                 }
  37         }'
  38 }
  39 
  40 [ ! -x /usr/sbin/zoneadm ] && exit 0    # SUNWzoneu not installed
  41 
  42 if [ -z "$SMF_FMRI" ]; then
  43         echo "this script can only be invoked by smf(5)"        
  44         exit $SMF_EXIT_ERR_NOSMF
  45 fi
  46 
  47 # Make sure working directory is / to prevent unmounting problems.
  48 cd /
  49 PATH=/usr/sbin:/usr/bin; export PATH
  50 
  51 case "$1" in
  52 'start')
  53         egrep -vs '^#|^global:' /etc/zones/index || exit 0  # no local zones
  54