summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2012-01-03 17:22:02 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2012-01-03 17:22:02 +0000
commitba620263ebf1fe619ffb19db37abf62533d193d6 (patch)
treea237cfc15c0a221440977ecb43def973c5cd6153 /usr/src
parent5d977ce82a18e6a1380c7a918bcfa3d40216d410 (diff)
downloadillumos-joyent-ba620263ebf1fe619ffb19db37abf62533d193d6.tar.gz
OS-809 a GZ process under the zonepath prevents zone shutdown
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/zoneadmd/vplat.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/usr/src/cmd/zoneadmd/vplat.c b/usr/src/cmd/zoneadmd/vplat.c
index b09f124dea..d0b85f3c18 100644
--- a/usr/src/cmd/zoneadmd/vplat.c
+++ b/usr/src/cmd/zoneadmd/vplat.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
+ * Copyright (c) 2011, 2012, Joyent Inc. All rights reserved.
*/
/*
@@ -710,6 +710,7 @@ unmount_filesystems(zlog_t *zlogp, zoneid_t zoneid, boolean_t unmount_cmd)
if (umount2(path, MS_FORCE) == 0) {
unmounted = B_TRUE;
stuck = B_FALSE;
+ fail = 0;
} else {
/*
* We may hit a failure here if there
@@ -723,12 +724,27 @@ unmount_filesystems(zlog_t *zlogp, zoneid_t zoneid, boolean_t unmount_cmd)
* this case, we will wait and retry
* a few times before we give up.
*/
- if (fail++ < 15) {
+ fail++;
+ if (fail < 16) {
zerror(zlogp, B_FALSE,
"unable to unmount '%s', "
"retrying in 1 second",
path);
(void) sleep(1);
+ } else if (fail == 16) {
+ char cmdbuf[MAXPATHLEN + 21];
+
+ zerror(zlogp, B_FALSE,
+ "unable to unmount '%s', "
+ "trying to kill GZ "
+ "processes",
+ path);
+ (void) snprintf(cmdbuf,
+ sizeof (cmdbuf),
+ "/usr/sbin/fuser -ck %s",
+ path);
+ (void) system(cmdbuf);
+ (void) sleep(2);
} else {
error++;
zerror(zlogp, B_FALSE,