11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
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
|
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
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 # At present, this means any running "lx" zones don't qualify.
32 #
33 shutdown_zones()
34 {
35 zoneadm list -p | nawk -F: '{
36 if (($5 != "lx") && ($2 != "global")) {
37 print $2
38 }
39 }'
40 }
41
42 [ ! -x /usr/sbin/zoneadm ] && exit 0 # SUNWzoneu not installed
43
44 if [ -z "$SMF_FMRI" ]; then
45 echo "this script can only be invoked by smf(5)"
46 exit $SMF_EXIT_ERR_NOSMF
47 fi
48
49 # Make sure working directory is / to prevent unmounting problems.
50 cd /
51 PATH=/usr/sbin:/usr/bin; export PATH
52
53 case "$1" in
54 'start')
55 egrep -vs '^#|^global:' /etc/zones/index || exit 0 # no local zones
56
|