diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2011-09-09 06:21:59 -0700 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2011-09-09 06:21:59 -0700 |
| commit | 4a949f8ecc59952cd3c5ed443b3ab29b4d5315e2 (patch) | |
| tree | fa9ae0ec0b2ff480fa2456a63714e456bb9fb2b6 /usr/src/cmd/zoneadmd/vplat.c | |
| parent | 2b3aa69e85c199f756aaf5f6afe387f8d0f4a16a (diff) | |
| download | illumos-joyent-4a949f8ecc59952cd3c5ed443b3ab29b4d5315e2.tar.gz | |
OS-592 zone stuck in down state
Diffstat (limited to 'usr/src/cmd/zoneadmd/vplat.c')
| -rw-r--r-- | usr/src/cmd/zoneadmd/vplat.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/usr/src/cmd/zoneadmd/vplat.c b/usr/src/cmd/zoneadmd/vplat.c index ccb2d867b4..77b4dc2334 100644 --- a/usr/src/cmd/zoneadmd/vplat.c +++ b/usr/src/cmd/zoneadmd/vplat.c @@ -622,6 +622,7 @@ static int unmount_filesystems(zlog_t *zlogp, zoneid_t zoneid, boolean_t unmount_cmd) { int error = 0; + int fail = 0; FILE *mnttab; struct mnttab *mnts; uint_t nmnt; @@ -711,16 +712,31 @@ unmount_filesystems(zlog_t *zlogp, zoneid_t zoneid, boolean_t unmount_cmd) stuck = B_FALSE; } else { /* - * The first failure indicates a - * mount we won't be able to get - * rid of automatically, so we - * bail. + * We may hit a failure here if there + * is an app in the GZ with an open + * pipe into the zone (commonly into + * the zone's /var/run). This type + * of app will notice the closed + * connection and cleanup, but it may + * take a while and we have no easy + * way to notice that. To deal with + * this case, we will wait and retry + * a few times before we give up. */ - error++; - zerror(zlogp, B_FALSE, - "unable to unmount '%s'", path); - free_mnttable(mnts, nmnt); - goto out; + if (fail++ < 15) { + zerror(zlogp, B_FALSE, + "unable to unmount '%s', " + "retrying in 1 second", + path); + (void) sleep(1); + } else { + error++; + zerror(zlogp, B_FALSE, + "unable to unmount '%s'", + path); + free_mnttable(mnts, nmnt); + goto out; + } } } /* |
