site  contact  subhomenews

Disconnect from network if hostname changed

May 05, 2012 — BarryK
Gcmartin started this thread:
http://www.murga-linux.com/puppy/viewtopic.php?t=77743

The script in Woof that is used to change the hostname is /usr/sbin/hostname-set.

I have modified this, so that if the hostname is changed, any network connection is brought down, and information is displayed that it must be reconnected for the new hostname to take effect.

From before, the post-change window also says that X must be restarted for the new hostname to take full effect, but I don't remember why that is required, if at all.

The new script can be viewed here. Woof commit:
http://bkhome.org/fossil/woof2.cgi/info/886f20e9b5

Comments

slacko released
Username: 01micko
Slacko 5.3.3 is released. I made a[url=http://01micko.com/slacko.html] home page with links to all relevant info. I reckon it looks cool! Lots of cool stuff in the distro too, not just a pretty face.. It does miss the latest PPM fixes and enhancements but I froze everything at RC. Enjoy!

Network automatic reconnection
Username: BarryK
"I have taken this one logical step further, and automated the network reconnection. Now what happens, when the hostname is changed, if there was an existing network connection, it is brought down, and the post-change info window informs that a restart of X is required (and when run from QuickSetup this X restart is logged to occur by simple press of a button), and upon X restart the network will also reconnect. The automatic reconnection is done by a new script, /usr/sbin/network_default_connect, that is called by /usr/bin/xwin (the X startup script). Woof commits: http://bkhome.org/fossil/woof2.cgi/info/76ff3102e9 http://bkhome.org/fossil/woof2.cgi/info/8b7d78e651

Why drop to X then ...
Username: GCMartin
"Hi Barry This goes all the way back to the problem with ROX when the hostname was changed. In that past, when a hostname change occurred, there were issues with ROX performance and other subsystem anomolies. The solution that resolved this was when s new system was started to FirstRUN, in efforts to resolve the system's inconsistencies, Playdayz, 01Micko, and Shinobar together worked up the solution that addressed this. On a logout-login, of the current user the system fields reappeared with consistency thru-out the system. ROX performance returned and all things have been happy....ever since this approach was instigated. TaZoC, in LH64, did something akin to this as well. Those distros that do NOT use FirstRUN continue to have those past issues. Specifically FATDOG and others. Sincle screen startup "FirstRUN" has done a great servcie to this community (developers and users alike. Here to help Thanks for all you've done.

Re hostname
Username: BarryK
"See later blog post: http://bkhome.org/archive/blog2/201205/hostname-updated-if-hostname-changed.html


Tags: woof