summaryrefslogtreecommitdiff
path: root/usr/src/cmd/zoneadmd/zoneadmd.c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2011-07-20 08:43:44 -0700
committerJerry Jelinek <jerry.jelinek@joyent.com>2011-07-20 08:43:44 -0700
commitc169e3f410e52ad753c783d87600dd4a6e9adb22 (patch)
treea62deeaa1a1e736ba2bbabd9d1cb4c1f42afd6be /usr/src/cmd/zoneadmd/zoneadmd.c
parentd64d613cdc671a93417a930933f6ca71c3b1e0de (diff)
downloadillumos-joyent-c169e3f410e52ad753c783d87600dd4a6e9adb22.tar.gz
OS-505 Create zone brand option that allows a brand to specify that when init fails, it should not be restarted
Diffstat (limited to 'usr/src/cmd/zoneadmd/zoneadmd.c')
-rw-r--r--usr/src/cmd/zoneadmd/zoneadmd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c
index 53926a307a..96249c65a6 100644
--- a/usr/src/cmd/zoneadmd/zoneadmd.c
+++ b/usr/src/cmd/zoneadmd/zoneadmd.c
@@ -915,6 +915,7 @@ zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate, boolean_t debug)
dladm_status_t status;
char errmsg[DLADM_STRSIZE];
int err;
+ boolean_t restart_init;
if (brand_prestatechg(zlogp, zstate, Z_BOOT, debug) != 0)
return (-1);
@@ -971,6 +972,9 @@ zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate, boolean_t debug)
goto bad;
}
+ /* See if this zone's brand should restart init if it dies. */
+ restart_init = brand_restartinit(bh);
+
brand_close(bh);
err = filter_bootargs(zlogp, bootargs, nbootargs, init_file,
@@ -1037,6 +1041,12 @@ zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate, boolean_t debug)
goto bad;
}
+ if (!restart_init && zone_setattr(zoneid, ZONE_ATTR_INITNORESTART,
+ NULL, 0) == -1) {
+ zerror(zlogp, B_TRUE, "could not set zone init-no-restart");
+ goto bad;
+ }
+
/*
* Inform zonestatd of a new zone so that it can install a door for
* the zone to contact it.