#!/usr/sbin/sh # # Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. # # Method script for the pools service. # . /lib/svc/share/smf_include.sh if [ ! -x /usr/sbin/pooladm ]; then echo "/usr/sbin/pooladm not found or not executable" exit $SMF_EXIT_ERR_FATAL fi if smf_is_nonglobalzone; then echo "pools service is only available in the global zone" exit $SMF_EXIT_ERR_FATAL fi case "$1" in 'start') /usr/sbin/pooladm -e if [ $? -ne 0 ]; then exit $SMF_EXIT_ERR_FATAL fi if [ -f /etc/pooladm.conf ]; then /usr/sbin/pooladm -c if [ $? -ne 0 ]; then /usr/sbin/pooladm -d exit $SMF_EXIT_ERR_CONFIG fi fi ;; 'stop') /usr/sbin/pooladm -x if [ $? -ne 0 ]; then exit $SMF_EXIT_ERR_FATAL fi /usr/sbin/pooladm -d if [ $? -ne 0 ]; then exit $SMF_EXIT_ERR_FATAL fi ;; 'refresh') if [ -f /etc/pooladm.conf ]; then /usr/sbin/pooladm -c if [ $? -ne 0 ]; then exit $SMF_EXIT_ERR_CONFIG fi fi ;; *) echo "Usage: $0 { start | stop | refresh}" exit $SMF_EXIT_ERR_FATAL ;; esac exit $SMF_EXIT_OK