diff options
| author | dp <none@none> | 2006-03-09 01:36:44 -0800 |
|---|---|---|
| committer | dp <none@none> | 2006-03-09 01:36:44 -0800 |
| commit | 6927f468b0af7710df000f6b16f6ee413e1e3007 (patch) | |
| tree | 7402871f85c8bdc366c20b330ea94441180ff760 /usr/src/cmd/pools | |
| parent | fea70b5430ad76f6dd4330a35518de5f17b52e96 (diff) | |
| download | illumos-joyent-6927f468b0af7710df000f6b16f6ee413e1e3007.tar.gz | |
PSARC/2006/163 SMF_ZONENAME variable for smf_method(5)
6392792 calls to zonename(1) should be standardized, minimized
Diffstat (limited to 'usr/src/cmd/pools')
| -rw-r--r-- | usr/src/cmd/pools/poold/svc-poold | 22 | ||||
| -rw-r--r-- | usr/src/cmd/pools/svc-pools | 18 |
2 files changed, 23 insertions, 17 deletions
diff --git a/usr/src/cmd/pools/poold/svc-poold b/usr/src/cmd/pools/poold/svc-poold index 77b2e32773..98cf94393d 100644 --- a/usr/src/cmd/pools/poold/svc-poold +++ b/usr/src/cmd/pools/poold/svc-poold @@ -20,7 +20,7 @@ # CDDL HEADER END # # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -30,18 +30,22 @@ . /lib/svc/share/smf_include.sh -check_requirements () { - if [ ! -x /sbin/zonename ] || [ ! -x /usr/lib/pool/poold ] || - [ "${_INIT_ZONENAME:=`/sbin/zonename`}" != "global" ]; then - exit $SMF_EXIT_ERR_FATAL - fi -} +if [ ! -x /usr/lib/pool/poold ]; then + echo "/usr/lib/pool/poold not found or not executable" + exit $SMF_EXIT_ERR_FATAL +fi + +if smf_is_nonglobalzone; then + echo "poold cannot be run in non-global zones" + exit $SMF_EXIT_ERR_FATAL +fi -check_requirements case "$1" in 'start') /usr/lib/pool/poold - if [ $? -ne 0 ]; then + err=$? + if [ $err -ne 0 ]; then + echo "poold failed to start: error $err" exit $SMF_EXIT_ERR_FATAL fi ;; diff --git a/usr/src/cmd/pools/svc-pools b/usr/src/cmd/pools/svc-pools index 53858cd0fd..6652f2a80e 100644 --- a/usr/src/cmd/pools/svc-pools +++ b/usr/src/cmd/pools/svc-pools @@ -20,7 +20,7 @@ # CDDL HEADER END # # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -30,14 +30,16 @@ . /lib/svc/share/smf_include.sh -check_requirements () { - if [ ! -x /sbin/zonename ] || [ ! -x /usr/sbin/pooladm ] || - [ "${_INIT_ZONENAME:=`/sbin/zonename`}" != "global" ]; then - exit $SMF_EXIT_ERR_FATAL - fi -} +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 -check_requirements case "$1" in 'start') /usr/sbin/pooladm -e |
