aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librc/librc.c15
-rw-r--r--src/librc/rc.h.in1
2 files changed, 14 insertions, 2 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 5cf4898f..8b4e8d4e 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -228,8 +228,13 @@ static const char *
detect_container(const char *systype)
{
#ifdef __FreeBSD__
- if (systype && strcmp(systype, RC_SYS_JAIL) == 0)
- return RC_SYS_JAIL;
+ if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
+ if (strcmp(systype, RC_SYS_JAIL) == 0)
+ return RC_SYS_JAIL;
+ }
+
int jailed = 0;
size_t len = sizeof(jailed);
@@ -240,6 +245,8 @@ detect_container(const char *systype)
#ifdef __linux__
if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
if (strcmp(systype, RC_SYS_UML) == 0)
return RC_SYS_UML;
if (strcmp(systype, RC_SYS_VSERVER) == 0)
@@ -283,6 +290,8 @@ detect_vm(const char *systype)
{
#ifdef __NetBSD__
if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
if (strcmp(systype, RC_SYS_XEN0) == 0)
return RC_SYS_XEN0;
if (strcmp(systype, RC_SYS_XENU) == 0)
@@ -296,6 +305,8 @@ detect_vm(const char *systype)
#ifdef __linux__
if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
if (strcmp(systype, RC_SYS_XEN0) == 0)
return RC_SYS_XEN0;
if (strcmp(systype, RC_SYS_XENU) == 0)
diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
index 55fbc449..92ecbb4e 100644
--- a/src/librc/rc.h.in
+++ b/src/librc/rc.h.in
@@ -318,6 +318,7 @@ bool rc_service_daemons_crashed(const char *);
* Some services cannot work in these systems, or we do something else. */
#define RC_SYS_DOCKER "DOCKER"
#define RC_SYS_JAIL "JAIL"
+#define RC_SYS_NONE ""
#define RC_SYS_OPENVZ "OPENVZ"
#define RC_SYS_LXC "LXC"
#define RC_SYS_PREFIX "PREFIX"