summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordp <none@none>2006-08-25 18:34:02 -0700
committerdp <none@none>2006-08-25 18:34:02 -0700
commite30bbc33865959d55cffa5ae883464a00a60b080 (patch)
tree14003675b8f050cdf2fa8bdaf77829bea081f20c
parentfacf4a8d7b59fde89a8662b4f4c73a758e6c402c (diff)
downloadillumos-joyent-e30bbc33865959d55cffa5ae883464a00a60b080.tar.gz
6464209 bfu shouldn't use .../method/svc-zones directly (6402848 broke bfu)
-rw-r--r--usr/src/cmd/zoneadm/svc-zones6
-rw-r--r--usr/src/tools/scripts/bfu.sh14
2 files changed, 15 insertions, 5 deletions
diff --git a/usr/src/cmd/zoneadm/svc-zones b/usr/src/cmd/zoneadm/svc-zones
index 34cdef6b8b..dc6345b533 100644
--- a/usr/src/cmd/zoneadm/svc-zones
+++ b/usr/src/cmd/zoneadm/svc-zones
@@ -25,9 +25,15 @@
# ident "%Z%%M% %I% %E% SMI"
#
+. /lib/svc/share/smf_include.sh
[ ! -x /usr/sbin/zoneadm ] && exit 0 # SUNWzoneu not installed
+if [ -z "$SMF_FMRI" ]; then
+ echo "this script can only be invoked by smf(5)"
+ exit $SMF_EXIT_ERR_NOSMF
+fi
+
# Make sure working directory is / to prevent unmounting problems.
cd /
PATH=/usr/sbin:/usr/bin; export PATH
diff --git a/usr/src/tools/scripts/bfu.sh b/usr/src/tools/scripts/bfu.sh
index 2f43a355fd..603231e1cf 100644
--- a/usr/src/tools/scripts/bfu.sh
+++ b/usr/src/tools/scripts/bfu.sh
@@ -3768,13 +3768,17 @@ then
/etc/init.d/zones stop
elif [ -x /lib/svc/method/svc-zones ]; then
#
- # Calling the zone service method directly is
- # the most straightforward way to block until
- # all zones are halted. Finding a way that
- # works once zones are made restartable is an
- # exercise left to the reader.
+ # We need all zones to be down before proceeding.
+ # We can't accomplish this by just disabling the
+ # zones service, since it might already be disabled.
+ # So we pretend to be SMF, and invoke the stop method.
#
+ # When zones are someday independently managed as
+ # service instances, this will need to be revised.
+ #
+ export SMF_FMRI="svc:/system/zones:default"
/lib/svc/method/svc-zones stop
+ unset SMF_FMRI
fi
[ -z `zoneadm list | grep -v global` ] || \