diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2012-01-03 17:22:02 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2012-01-03 17:22:02 +0000 |
commit | ba620263ebf1fe619ffb19db37abf62533d193d6 (patch) | |
tree | a237cfc15c0a221440977ecb43def973c5cd6153 /usr/src | |
parent | 5d977ce82a18e6a1380c7a918bcfa3d40216d410 (diff) | |
download | illumos-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.c | 20 |
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, |