Philipp Wehrheim <flips...@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?

_______________________________________________
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users

Reply via email to