From 95ee39ab1c9ce313725098999cf1d05b42f9c126 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 4 Nov 2009 19:21:24 +0000 Subject: Add support for Linux Containers, fixes #202. Patch by bug reporter. --- src/librc/librc.c | 2 ++ src/librc/rc.h.in | 1 + 2 files changed, 3 insertions(+) (limited to 'src/librc') diff --git a/src/librc/librc.c b/src/librc/librc.c index 96e3195d..34bd9e15 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -233,6 +233,8 @@ rc_sys(void) return RC_SYS_VSERVER; else if (exists("/proc/vz/veinfo") && !exists("/proc/vz/version")) return RC_SYS_OPENVZ; + else if (file_regex("/proc/self/cgroup", ":/.+$")) + return RC_SYS_LXC; else if (file_regex("/proc/self/status", "envID:[[:space:]]*[1-9]")) return RC_SYS_OPENVZ; /* old test */ diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in index 373f1d1e..4b7977eb 100644 --- a/src/librc/rc.h.in +++ b/src/librc/rc.h.in @@ -268,6 +268,7 @@ bool rc_service_daemons_crashed(const char *); * Some services cannot work in these systems, or we do something else. */ #define RC_SYS_JAIL "JAIL" #define RC_SYS_OPENVZ "OPENVZ" +#define RC_SYS_LXC "LXC" #define RC_SYS_PREFIX "PREFIX" #define RC_SYS_UML "UML" #define RC_SYS_VSERVER "VSERVER" -- cgit v1.2.3