site  contact  subhomenews

HOSTNAME updated if hostname changed

May 11, 2012 — BarryK
An issue with the network when hostname is changed, was discussed recently on this blog, and I applied a fix in Woof:
http://bkhome.org/archive/blog2/201205/disconnect-from-network-if-hostname-changed.html

There has been ongoing discussion on the Puppy Forum:
http://www.murga-linux.com/puppy/viewtopic.php?t=77743

...in which it was mentioned one problem is that the global variable HOSTNAME does not get updated until a reboot. Some applications read this variable.

HOSTNAME is exported in /etc/profile at bootup. However, as QuickSetup recommends to restart X after hostname is changed, there is the opportunity to export the updated HOSTNAME variable.
This is already done in the case of the LANG variable, which is exactly the same situation, exported in /etc/profile, and may be changed by QuickSetup.

The code that exports the updated LANG and HOSTNAME variables is /usr/bin/xwin. Woof commit:
http://bkhome.org/fossil/woof2.cgi/info/c440074e1c

Comments

Solution appropriate



Tags: woof