[prev in list] [next in list] [prev in thread] [next in thread]
List: openvz-users
Subject: [Users] Re: finding out the HN name from inside the VC
From: aleksandar () ivanisevic ! de (Aleksandar Ivanisevic)
Date: 2010-03-01 9:23:39
Message-ID: m3d3zo15ps.fsf () alex ! 2e-systems ! com
[Download RAW message or body]
Philipp Wehrheim <flipstar@gmx.net> writes:
> Hey,
>
> Aleksandar Ivanisevic schrieb:
>>
>> Is there a more elegant way of finding the host name or anything about
>> the host node from inside the container than scripting something in
>> /etc/vz/conf/vps.mount ?
>
> if you are only searching for the hostname you could use
>
> cat /proc/sys/kernel/virt_osrelease | sed "s,openvz,$(uname -n),g" >/proc/sys/kernel/virt_osrelease
>
> and
>
> cat /proc/sys/kernel/virt_osrelease
I'm using RHEL/Centos kernel so my osrelease looks like
$ cat /proc/sys/kernel/virt_osrelease
2.6.18-164.11.1.el5.028stab068.3
so your sed doesn't really work, but the general idea is also neat,
although I'm not really sure what side efects can messing with uname
-r have. I guess glibc and others only check the main version so I can
write anythin in there as long as it starts with 2.6.18-, right?
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic