1 1042 garypen #!/sbin/sh 2 1042 garypen # 3 1042 garypen # CDDL HEADER START 4 1042 garypen # 5 1042 garypen # The contents of this file are subject to the terms of the 6 1042 garypen # Common Development and Distribution License (the "License"). 7 1042 garypen # You may not use this file except in compliance with the License. 8 1042 garypen # 9 1042 garypen # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 1042 garypen # or http://www.opensolaris.org/os/licensing. 11 1042 garypen # See the License for the specific language governing permissions 12 1042 garypen # and limitations under the License. 13 1042 garypen # 14 1042 garypen # When distributing Covered Code, include this CDDL HEADER in each 15 1042 garypen # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 1042 garypen # If applicable, add the following below this CDDL HEADER, with the 17 1042 garypen # fields enclosed by brackets "[]" replaced with your own identifying 18 1042 garypen # information: Portions Copyright [yyyy] [name of copyright owner] 19 1042 garypen # 20 1042 garypen # CDDL HEADER END 21 1042 garypen # 22 1042 garypen # 23 1573 dp # Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24 1042 garypen # Use is subject to license terms. 25 1042 garypen # 26 1042 garypen # ident "%Z%%M% %I% %E% SMI" 27 1042 garypen # 28 1042 garypen # Method script for the pools service. 29 1042 garypen # 30 1042 garypen 31 1042 garypen . /lib/svc/share/smf_include.sh 32 1042 garypen 33 1573 dp if [ ! -x /usr/sbin/pooladm ]; then 34 1573 dp echo "/usr/sbin/pooladm not found or not executable" 35 1573 dp exit $SMF_EXIT_ERR_FATAL 36 1573 dp fi 37 1042 garypen 38 1573 dp if smf_is_nonglobalzone; then 39 1573 dp echo "pools service is only available in the global zone" 40 1573 dp exit $SMF_EXIT_ERR_FATAL 41 1573 dp fi 42 1573 dp 43 1042 garypen case "$1" in 44 1042 garypen 'start') 45 1042 garypen /usr/sbin/pooladm -e 46 1042 garypen if [ $? -ne 0 ]; then 47 1042 garypen exit $SMF_EXIT_ERR_FATAL 48 1042 garypen fi 49 1042 garypen if [ -f /etc/pooladm.conf ]; then 50 1042 garypen /usr/sbin/pooladm -c 51 1042 garypen if [ $? -ne 0 ]; then 52 1042 garypen /usr/sbin/pooladm -d 53 1042 garypen exit $SMF_EXIT_ERR_CONFIG 54 1042 garypen fi 55 1042 garypen fi 56 1042 garypen ;; 57 1042 garypen 'stop') 58 1042 garypen /usr/sbin/pooladm -x 59 1042 garypen if [ $? -ne 0 ]; then 60 1042 garypen exit $SMF_EXIT_ERR_FATAL 61 1042 garypen fi 62 1042 garypen /usr/sbin/pooladm -d 63 1042 garypen if [ $? -ne 0 ]; then 64 1042 garypen exit $SMF_EXIT_ERR_FATAL 65 1042 garypen fi 66 1042 garypen ;; 67 1042 garypen 'refresh') 68 1042 garypen if [ -f /etc/pooladm.conf ]; then 69 1042 garypen /usr/sbin/pooladm -c 70 1042 garypen if [ $? -ne 0 ]; then 71 1042 garypen exit $SMF_EXIT_ERR_CONFIG 72 1042 garypen fi 73 1042 garypen fi 74 1042 garypen ;; 75 1042 garypen *) 76 1042 garypen echo "Usage: $0 { start | stop | refresh}" 77 1042 garypen exit $SMF_EXIT_ERR_FATAL 78 1042 garypen ;; 79 1042 garypen esac 80 1042 garypen 81 1042 garypen exit $SMF_EXIT_OK 82