aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librc/librc.c7
-rw-r--r--src/librc/rc.h3
-rw-r--r--src/rc/rc.c4
3 files changed, 9 insertions, 5 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 16b0f0b7..c6280d15 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -207,8 +207,11 @@ const char *rc_sys (void)
} else if (file_regex ("/proc/cpuinfo", "UML"))
return (RC_SYS_UML);
else if (file_regex ("/proc/self/status",
- "(s_context|VxID|envID):[[:space:]]*[1-9]"))
- return (RC_SYS_VPS);
+ "(s_context|VxID):[[:space:]]*[1-9]"))
+ return (RC_SYS_VSERVER);
+ else if (file_regex ("/proc/self/status",
+ "envID:[[:space:]]*[1-9]"))
+ return (RC_SYS_OPENVZ);
#endif
return (NULL);
diff --git a/src/librc/rc.h b/src/librc/rc.h
index d2fde601..0b811f46 100644
--- a/src/librc/rc.h
+++ b/src/librc/rc.h
@@ -232,9 +232,10 @@ bool rc_service_daemons_crashed (const char *service);
* OpenRC can support some special sub system types, normally virtualization.
* 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_PREFIX "PREFIX"
#define RC_SYS_UML "UML"
-#define RC_SYS_VPS "VPS"
+#define RC_SYS_VSERVER "VSERVER"
#define RC_SYS_XEN0 "XEN0"
#define RC_SYS_XENU "XENU"
const char *rc_sys (void);
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 183c23c3..e1b7ac3d 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -289,8 +289,8 @@ static void sulogin (bool cont)
#ifdef __linux__
char *e = getenv ("RC_SYS");
- /* VPS systems cannot do a sulogin */
- if (e && strcmp (e, "VPS") == 0) {
+ /* VSERVER and OPENVZ systems cannot do a sulogin */
+ if (e && (strcmp (e, "VSERVER") == 0 || strcmp (e, "OPENVZ") == 0) {
execl ("/sbin/halt", "/sbin/halt", "-f", (char *) NULL);
eerrorx ("%s: unable to exec `/sbin/halt': %s", applet, strerror (errno));
}