Browse Source

procd: Adding support to detect Pantavisor Container Platform

Modified container.h to detect the pantavisor container platform,
as it runs a custom modified version of LXC. container.h is modified
to check if procd is running in a pantavisor container environment by
detecting the presence of pantavisor directory under /.

Signed-off-by: Gaurav Pathak <gaurav.pathak@pantacor.com>
Gaurav Pathak 3 years ago
parent
commit
7ee456346b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      container.h

+ 2 - 1
container.h

@@ -21,7 +21,8 @@
 static inline bool is_container() {
 	struct stat s;
 	int r = stat("/.dockerenv", &s);
-	return !!getenv("container") || r == 0;
+	int pv_r = stat("/pantavisor", &s);
+	return !!getenv("container") || r == 0 || pv_r == 0;
 }
 
 #endif