[Users] reliably detect wether hardware_node,
openvz_host or openvz_instance
martin at marcher.name
Mon Jul 28 09:07:34 EDT 2008
I'm looking for a way to reliably tell (thru shell) wether I'm on a
pure hardware_node, openvz_host or inside an instance. I'd like to not
rely on any tools from packages, I'd rather use information from /proc
So far I came up with a very simple test, I'm pretty sure it's
somewhere in the manual but I'm just to blind to find that.
if [ -f /proc/user_beancounters ]; then
grep -E '^[[:blank:]]+0:' /proc/user_beancounters 2>/dev/null;
if [ $? -eq 0 ]; then
You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.
More information about the Users