diff options
| author | Gaurav Pathak | 2021-03-21 13:14:33 +0000 |
|---|---|---|
| committer | Daniel Golle | 2021-03-21 13:23:25 +0000 |
| commit | 7ee456346baca29af40a6d1a5071e57f32ebf762 (patch) | |
| tree | 0cc7bbbed482852337b610f1d2a72411826c5074 | |
| parent | c23d8bf81624469ed97449af7bf9497ee2c351c2 (diff) | |
| download | procd-7ee456346baca29af40a6d1a5071e57f32ebf762.tar.gz | |
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>
| -rw-r--r-- | container.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/container.h b/container.h index 903e3e8..dede696 100644 --- a/container.h +++ b/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 |