summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2020-04-14 00:00:00 -0500
committerCraig Small <csmall@dropbear.xyz>2020-04-20 22:07:43 +1000
commit5cb46d3533bf39c1ccbe10154e284dfc218b7b61 (patch)
treecd62ca675b1d09bbe68128f9c44b19b4cce1ba94
parentebaa5f28232967b8e479ef2d23e3cfe76f6efd9c (diff)
downloadprocps-ng-5cb46d3533bf39c1ccbe10154e284dfc218b7b61.tar.gz
library: adapted to the latest lxc conventions (again)
Well, shit! With release 4.0 on March 25th the lxc/lxd folks have stuck it to us once again. They changed the cgroup lxc prefix used to identify the container name. Signed-off-by: Jim Warner <james.warner@comcast.net>
-rw-r--r--proc/readproc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/proc/readproc.c b/proc/readproc.c
index b5584c8..7264ad5 100644
--- a/proc/readproc.c
+++ b/proc/readproc.c
@@ -911,15 +911,17 @@ static char *lxc_containers (const char *path) {
1:cpuset,cpu,cpuacct,devices,freezer,net_cls,blkio,perf_event,net_prio:/lxc/lxc-P
*/
if (file2str(path, "cgroup", &ub) > 0) {
- /* ouch, next two defaults could be changed at lxc ./configure time
+ /* ouch, the next defaults could be changed at lxc ./configure time
( and a changed 'lxc.cgroup.pattern' is only available to root ) */
- static const char *lxc_delm1 = "lxc.payload/"; // with lxc-3.1.0
- static const char *lxc_delm2 = "lxc/"; // thru lxc-3.0.3
+ static const char *lxc_delm1 = "lxc.payload."; // with lxc-4.0.0
+ static const char *lxc_delm2 = "lxc.payload/"; // thru lxc-3.2.1
+ static const char *lxc_delm3 = "lxc/"; // thru lxc-3.0.3
const char *delim;
char *p1;
if ((p1 = strstr(ub.buf, (delim = lxc_delm1)))
- || ((p1 = strstr(ub.buf, (delim = lxc_delm2))))) {
+ || ((p1 = strstr(ub.buf, (delim = lxc_delm2)))
+ || ((p1 = strstr(ub.buf, (delim = lxc_delm3)))))) {
static struct lxc_ele {
struct lxc_ele *next;
char *name;