From 9802467bbb26ae74d5702f814a440642009edfc9 Mon Sep 17 00:00:00 2001 From: Stephan Leemburg Date: Wed, 22 Jun 2016 13:17:03 +0200 Subject: [PATCH] Add openvz/lxc discovery --- cdist/conf/explorer/machine_type | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cdist/conf/explorer/machine_type b/cdist/conf/explorer/machine_type index 74789f5a..c0541ad5 100755 --- a/cdist/conf/explorer/machine_type +++ b/cdist/conf/explorer/machine_type @@ -22,6 +22,17 @@ # FIXME: other system types (not linux ...) +if [ -d "/proc/vz" -a ! -d "/proc/bc" ]; then + echo openvz + exit +fi + +if [ -e "/proc/1/environ" ] && + cat "/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container='; then + echo lxc + exit +fi + if [ -r /proc/cpuinfo ]; then # this should only exist on virtual guest machines, # tested on vmware, xen, kvm