User:Wainguo

How to change Linux's hostid
background

Today i was trying to fix the installation of purify(a rational memory test tool) under Linux envirenment. The release i used is licensed with the "FLEXlm license manager". This license server publish its license with given IP and hostid, the purify is always work well until i changed the host's IP address. I've got an valid permanent license before, which was binding with the old IP address. Somehow we need to do this change(eg: our local area network's IP assign changed ).

solve method

♦Keep an old IP address in this host is easy, just make a ifcfg-eth0 like network-script file with the old IP configured, and run ifup to turn this config on.

♦Then, to bring purify license available I must change the hostid. The hostid,by default,to be determined by the eth0's IP configuration. For example, the IP:192.168.2.169 would be computed to hostid:a8c0a902, more specifically: a8(168)c0(192)a9(169)02(2). You can invoke hostid command to see current hostid's content. If you run strace command to see what hostid command do in detail, you will find it first will access the file /etc/hostid to resolve the hostid. We can use its this behavior to change the hostid. Here comes the solution: Program and run this: This will save the hostid info to the file /etc/hostid. now the hostid is changed and the purify's license works again. --218.249.60.66 (talk) 12:37, 5 May 2008 (UTC)