OpenVZ Forum


Home » Mailing lists » Users » /usr/bin/hostid in VPS
/usr/bin/hostid in VPS [message #30927] Tue, 10 June 2008 19:07 Go to next message
ajneil is currently offline  ajneil
Messages: 11
Registered: November 2006
Location: Fairfax
Junior Member
From: openvz.org
I would like to encapsulate a server that runs a variety of license managers
including flexlm.  Many of these systems rely on generating a hostid
generally either the MAC address of the primary network interface or a hash
generated by /usr/bin/hostid.  In an OpenVZ VPS hostid returns 00000000, is
there a way to spoof this so that I can keep the license managers happy
regadless of the system/network inferface it is actually using? I tried
setting up a veth device that spoofed the original MAC address but hostid
still returns 00000000.

Thanks, Alastair
Re: /usr/bin/hostid in VPS [message #31018 is a reply to message #30927] Fri, 13 June 2008 08:06 Go to previous message
Josip Rodin is currently offline  Josip Rodin
Messages: 14
Registered: November 2007
Junior Member
From: openvz.org
On Tue, Jun 10, 2008 at 03:07:21PM -0400, Alastair Neil wrote:
> I would like to encapsulate a server that runs a variety of license managers
> including flexlm.  Many of these systems rely on generating a hostid
> generally either the MAC address of the primary network interface or a hash
> generated by /usr/bin/hostid.  In an OpenVZ VPS hostid returns 00000000, is
> there a way to spoof this so that I can keep the license managers happy
> regadless of the system/network inferface it is actually using? I tried
> setting up a veth device that spoofed the original MAC address but hostid
> still returns 00000000.

That program basically returns the value of the gethostid() call, and that
comes from <unistd.h>. As far as I can tell from glibc sources
(sysdeps/unix/sysv/linux/gethostid.c) all you need to do is edit
the file /etc/hostid (either with something that calls sethostid() or
manually)...?

-- 
     2. That which causes joy or happiness.
Previous Topic: iosched question
Next Topic: Veth mac generation
Goto Forum:
  


Current Time: Mon Sep 16 10:24:52 GMT 2019