diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2014-04-30 21:01:47 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2014-04-30 21:01:47 +0000 |
commit | 1a5d40de65533ba52e9a69a42ab1b3bf51b69b9c (patch) | |
tree | 7df99b21cbb3cfd9ea379b09150c2044f9b0efca | |
parent | 21a8a21bb3b493bb2c71f3b0d21cb5af876511eb (diff) | |
download | illumos-joyent-1a5d40de65533ba52e9a69a42ab1b3bf51b69b9c.tar.gz |
OS-2843 zone memory capper should work with lx branded zones
-rw-r--r-- | usr/src/cmd/zoneadmd/mcap.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/usr/src/cmd/zoneadmd/mcap.c b/usr/src/cmd/zoneadmd/mcap.c index 3601ad8fa6..63e319587b 100644 --- a/usr/src/cmd/zoneadmd/mcap.c +++ b/usr/src/cmd/zoneadmd/mcap.c @@ -1261,6 +1261,7 @@ void create_mcap_thread(zlog_t *zlogp, zoneid_t id) { int res; + char brandname[MAXNAMELEN]; shutting_down = 0; zid = id; @@ -1268,7 +1269,20 @@ create_mcap_thread(zlog_t *zlogp, zoneid_t id) if (zone_get_zonepath(zonename, zonepath, sizeof (zonepath)) != 0) zerror(zlogp, B_FALSE, "zone %s missing zonepath", zonename); - (void) snprintf(zoneproc, sizeof (zoneproc), "%s/root/proc", zonepath); + + brandname[0] = '\0'; + if (zone_get_brand(zonename, brandname, sizeof (brandname)) != 0) + zerror(zlogp, B_FALSE, "zone %s missing brand", zonename); + + /* all but the lx brand currently use /proc */ + if (strcmp(brandname, "lx") == 0) { + (void) snprintf(zoneproc, sizeof (zoneproc), + "%s/root/native/proc", zonepath); + } else { + (void) snprintf(zoneproc, sizeof (zoneproc), "%s/root/proc", + zonepath); + } + (void) snprintf(debug_log, sizeof (debug_log), "%s/mcap_debug.log", zonepath); |