[ILUG] changing hostid in linux 7.2

paul at clubi.ie paul at clubi.ie
Fri Dec 15 13:47:47 GMT 2006


On Thu, 14 Dec 2006, Walter Faleiro wrote:

> Folks,
> I have an application that runs tied with hostid of the system. Recently
> reformatting the drive changed the hostid to 7f0100.

I.e. the IP address 127.0.0.1.

> Is there anyway I can change the hostid in 7.2? I tried a few posts 
> but unlike FreeBSD and Solaris there seems to be little hope for 
> me.

I think you just need to change /etc/hosts so that 'hostname' returns 
a name whose first IPv4 address is 127.0.0.1.

Alternatively, just write a tiny object file to implement your 
gethostid() function, returning whatever you want, and LD_PRELOAD it 
when running your application.

regards,
-- 
Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Fortune:
An age is called Dark not because the light fails to shine, but because
people refuse to see it.
 		-- James Michener, "Space"



More information about the ILUG mailing list