diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2015-12-02 09:19:45 -0600 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2015-12-02 10:20:39 -0600 |
commit | a0cf8f91246ff4487b36d6432dab787e5b10957d (patch) | |
tree | dd73f29093d63ea9f67eaed2ffec4220dc5f91d9 /src/librc | |
parent | 9fedb3b40b5983372b2c2de29dfe321c6dfaadf4 (diff) |
Add detection for rkt containers
Diffstat (limited to 'src/librc')
-rw-r--r-- | src/librc/librc.c | 4 | ||||
-rw-r--r-- | src/librc/rc.h.in | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c index cad80333..c041647c 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -267,6 +267,8 @@ rc_sys(void) return RC_SYS_OPENVZ; if (strcmp(systype, RC_SYS_LXC) == 0) return RC_SYS_LXC; + if (strcmp(systype, RC_SYS_RKT) == 0) + return RC_SYS_RKT; if (strcmp(systype, RC_SYS_SYSTEMD_NSPAWN) == 0) return RC_SYS_SYSTEMD_NSPAWN; if (strcmp(systype, RC_SYS_DOCKER) == 0) @@ -288,6 +290,8 @@ rc_sys(void) return RC_SYS_OPENVZ; /* old test */ else if (file_regex("/proc/1/environ", "container=lxc")) return RC_SYS_LXC; + else if (file_regex("/proc/1/environ", "container=rkt")) + return RC_SYS_RKT; else if (file_regex("/proc/1/environ", "container=systemd-nspawn")) return RC_SYS_SYSTEMD_NSPAWN; else if (file_regex("/proc/1/environ", "container=docker")) diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in index 360c26a1..30c0f8dc 100644 --- a/src/librc/rc.h.in +++ b/src/librc/rc.h.in @@ -334,6 +334,7 @@ bool rc_service_daemons_crashed(const char *); #define RC_SYS_OPENVZ "OPENVZ" #define RC_SYS_LXC "LXC" #define RC_SYS_PREFIX "PREFIX" +#define RC_SYS_RKT "RKT" #define RC_SYS_SYSTEMD_NSPAWN "SYSTEMD-NSPAWN" #define RC_SYS_UML "UML" #define RC_SYS_VSERVER "VSERVER" |