[Users] How to determine a container from the filesystem?

Kir Kolyshkin kir at openvz.org
Tue Apr 17 03:29:23 EDT 2012


On 04/14/2012 12:07 AM, Brad Alexander wrote:
> I just found out through the proxmox-ve forums that running ntp on a
> container is considered a Bad Thing.

Not necessarily. In fact, it's a good thing to run ntpd inside a 
container, it's just you need to

1. Have only ONE container doing that.
2. Grant that container sys_time capability, so it will be able to set 
system time.

This is because time is not virtualized, ie all the containers share the 
same time (because indeed there's only one time -- time zones of course 
can be different).

> So I am reworking my puppet
> installation to disable ntp on the containers...But I was trying to
> figure out a foolproof way of looking on the machine and determining
> if it is a container or not. The only thing I have found so far is
> that /proc/mtrr exists on the physical servers, but not on the
> containers. Is this a viable way to make this determination or is
> there a better way?

Solutions provided here in this thread by E Frank Ball and Martin Dobrev 
are both good.


More information about the Users mailing list