HOSTNAME fixes ROX slowness problem - SOLVED

Using applications, configuring, problems
Message
Author
gcmartin

01Micko

#21 Post by gcmartin »

Starting with 01Micko's approach we would arrinve at desktop with a PC on the LAN that is unique. This would suffice for most newbies who would NOT take the time or effort to change the hostname from the defautl that may ve offered on screen to them.

It this is done on initial boot (pfix=ram) there could also be an option somewhere which would force/ask the booting user to enter/change a name for this booting PC. This would, I thnk address 90& of situations for having the system named and the user to know what the name of the booting PC is. As well, all system applications would have consistent information no matter which field they would use internally for their ooperation. Were this to be done, we would cover most situations of IDing the system hostname fields and would significantly reduce/negaate a need to use the hostname command once the system is at desktop.

This seems reasonable.

Does anyone see a problem with an approach like that?

User avatar
shinobar
Posts: 2672
Joined: Thu 28 May 2009, 09:26
Location: Japan
Contact:

HOSTNAME problem

#22 Post by shinobar »

To make hostname=HOSTNAME for ROX, we need to reboot PC after the hostname is changed.
Rebooting X is not enough because the script /usr/bin/xwin does not read /etc/profile at reboot.
I am not sure it causes problem, but i think there is a hint.

BTW, connecting tools for puppy should be improved to use the hostname provided from the DHCP service.
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]

gcmartin

Hint at HOSTNAME problem. One path to solution

#23 Post by gcmartin »

shinobar wrote:To make hostname=HOSTNAME for ROX, we need to reboot PC after the hostname is changed.
Rebooting X is not enough because the script /usr/bin/xwin does not read /etc/profile at reboot.
I am not sure it causes problem, but i think there is a hint.

BTW, connecting tools for puppy should be improved to use the hostname provided from the DHCP service.
Hi Shinobar. Thanks for helping.

Couple of points.

#1
All (most) consumer routers do NOT supply a hostname to a PC when issuing IP personality to the PC.

#2 - Is this a possible hint to a solution?
I did find something of interest, when running latest PUP268.
  1. The system boots to FirstRun/Personalize Settings.
  2. I changed the hostname field from puppypc to Luci268-01
  3. I clicked OK to confirm
  4. System gave the normal restart desktop message
  5. I then selected SHUTDOWN > Exit to Prompt
  6. At the prompt, I typed logout
  7. at the next prompt, I typed xwin
  8. desktop restarted
  9. I clicked console icon on desktop, typed "echo $HOSTNAME" and was surprised to find that the hostname is updated by the system to Luci268-01.
This works on this Puppy by Playdayz. I am not sure how many other PUP distros this would work on.

I run a LIve media environment, and this is verifiable by anyone for Pup268. I am not sure how many other PUPs that use FirstRUN to go to desktop, but those PUP distros, who use Personalize Settings may also have the same benefit that its has with Playdayz's-01Micko's distro

Is this a hint to solution?

So, it seems that changes made in the Personalize Settings Utility MAY accomplish the job whenever it run IFF it can accomplish a logout and xwin when the hostname is changed. Can FirstRun be modified to do this when the hostname is changed?

This may be a solution that CAN be incorporated or modeled for all PUPs. If so,

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#24 Post by amigo »

Here's a good read about the what, how and why of hostname and domain names:
http://jblevins.org/notes/hostname

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#25 Post by 01micko »

Interesting read amigo. with that in mind here is what is going in my /etc/rc.d/rc.sysint file just after rc.update is run

Code: Select all

if [ "`cat /etc/hostname`" = "puppypc" ];then #110807 
 echo -n "Updating unique hostname..." >/dev/console 
 echo "puppypc${RANDOM}" > /etc/hostname
 PUPHOSTNAME="`cat /etc/hostname`"
 HOSTSFILEFIRST="`grep -w 'puppypc' /etc/hosts|sed 's% puppypc%%'`" #first line
 HOSTSFILEREST="`grep -v 'puppypc' /etc/hosts`" #rest of file
 echo "$HOSTSFILEFIRST $PUPHOSTNAME" > /etc/hosts
 echo "$HOSTSFILEREST" >> /etc/hosts
 status_func 0 #outputs a "done" msg
fi
That won't upset the apple cart if the user has changed "localhost" and added addresses to /etc/hosts (though at the stage it's run that's extremely unlikely to have happened anyway, unless some one has done a remaster/rebuild)

EDIT: Works fine :)

Code: Select all

# cat /etc/hostname
puppypc9408
# cat /etc/hosts
127.0.0.1 localhost puppypc9408
192.168.1.1 pc2
192.168.1.2 pc3
192.168.1.3 pc4
# echo $HOSTNAME
puppypc9408
# uname -n
puppypc9408
# cat /proc/sys/kernel/hostname
puppypc9408
# sysctl kernel.hostname
kernel.hostname = puppypc9408
EDIT2: My hostname is persistent after a reboot.

I'll attach my /etc/rc.d/rc.sysinit, note, this is from latest woof
Attachments
rc.sysinit.gz
to open:
gunzip rc.sysinit.gz
(10.62 KiB) Downloaded 399 times
Puppy Linux Blog - contact me for access

gcmartin

#26 Post by gcmartin »

01micko wrote: ... here is ... /etc/rc.d/rc.sysint file just after rc.update is run ... That won't upset the apple cart if the user has changed "localhost" and added addresses to /etc/hosts (though at the stage it's run that's extremely unlikely to have happened anyway, unless some one has done a remaster/rebuild) ... hostname is persistent after a reboot. ...
This is well thought-thru, well structured, and well-presented here for understanding.

What 01Micko presents here, will work not only for Live media who are booting for the first-time, but also for startup tools similar to what @Shinobar's FirstRUN/Personalize Settings does for first-boot or for some subsequext use. It paves the way for any distro developer to use other desktop tools or applications that rely on consistent system information in this area.

Does anyone see any downsides? I don't see any at this time.

Help if you can. And Thanks again @01Micko for your level on LAN understanding and your OTB addressing this for all of us.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#27 Post by sc0ttman »

01micko wrote:Interesting read amigo. with that in mind here is what is going in my /etc/rc.d/rc.sysint file just after rc.update is run

[code-removed]

EDIT2: My hostname is persistent after a reboot.

I'll attach my /etc/rc.d/rc.sysinit, note, this is from latest woof
Doesn't his break pup-advert-blocker, each reboot?

If so, you can search for:

Code: Select all

# pup-advert-blocker IPs below
and

Code: Select all

# pup-advert-blocker IPs above
and keep everything between in it a variable, and put it back in the new hostname file.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#28 Post by 01micko »

sc0ttman

The test is to see if the hostname is "puppypc". If anything else is found then that code block is skipped.

If pupadvert blocker is installed previously with a bunch of addresses the addresses are preserved. See the variable "HOSTSFILEREST"

Cheers
Puppy Linux Blog - contact me for access

gcmartin

LightHouse64 PUP is handling it correctly

#29 Post by gcmartin »

LightHOUSE64 PUP is running a "Modified" version of Personalize Settings on 64bit PCs.which does everything we are discussing in this thread.

As most of us know, Personalize Settings is becoming an user appealing startup utility for doing some very basic system needs on the Puppy desktop; instead of continually stopping during boot processing to ask users questions for system settings needs. This approach is practical as well as appealing while giving any user a Menu item that he can return to whenever needed to make some setting change.

I don't know what he's done as 64bit Linux "MAY" offer something 32bit does not, but, his Personalize Settings updates ALL known needs for hostname in the system when you click OK. This means that every field that a hostname change should address is being addressed, correctly, all within the running desktop!. Maybe he found something in Personalize Settings that handles this for all system fields-files that is overlooked in 32bit PC's use of Personalize Settings.

I am appealing to TazOC for some insights that could be applied in the 32bit community (or ALL PUPs, in general).

Hope this helps
Attachments
Personalize Settings in LightHouse64.png
64bit LightHouse64
(103.12 KiB) Downloaded 1036 times
After PS completion.png
ALL pertinent fields are accurate
(32.15 KiB) Downloaded 1087 times

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#30 Post by sc0ttman »

01micko wrote:sc0ttman

The test is to see if the hostname is "puppypc". If anything else is found then that code block is skipped.

If pupadvert blocker is installed previously with a bunch of addresses the addresses are preserved. See the variable "HOSTSFILEREST"

Cheers
whoops, oh yeah, didn't read it correctly.. I'm gonna go ahead and add this.. 8)
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
tazoc
Posts: 1157
Joined: Mon 11 Dec 2006, 08:07
Location: Lower Columbia Basin WA US
Contact:

Re: LightHouse64 PUP is handling it correctly

#31 Post by tazoc »

gcmartin wrote:I am appealing to TazOC for some insights that could be applied in the 32bit community (or ALL PUPs, in general).
The only change to Personalize Settings in Lighthouse 64-511 Update 1 (related to hostname) is the same one that Shinobar has incorporated at line 1199 of /usr/sbin/countrywizard.qs in firstrun-1.8.4:

Code: Select all

   hostname $HOSTNAME
   echo -n $HOSTNAME > /etc/hostname
   echo "127.0.0.1 localhost $HOSTNAME" > /tmp/hosts
   grep -vw 'localhost'  /etc/hosts >> /tmp/hosts
   [ -s /tmp/hosts ] && mv -f /tmp/hosts /etc/hosts
I appreciate Shinobar's fine work on this, as well as his and others efforts to improve NLS support. 01Micko's method to ensure a unique hostname seems like a good idea as well. Combined with Personalize Settings, the user is free, if so desired, to change the numerical suffix (or the entire hostname) to something easy to remember.

I also changed a line in /usr/sbin/ipinfo from

Code: Select all

	# tab 1 - interfaces
	var01=`echo Hostname: "$HOSTNAME"`
to

Code: Select all

	# tab 1 - interfaces
	var01=`echo Hostname: "$(hostname)"`
so that it reflects any change to hostname without having to reboot.
-TazOC
[url=http://www.lhpup.org/][b][size=100]lhpup.org[/size][/b] [img]http://www.lhpup.org/gallery/images/favicon.png[/img][/url] [url=http://www.lhpup.org/release-lhp.htm#602]Lighthouse 64 6.02[/url]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#32 Post by greengeek »

gcmartin - well done in bringing clarity to this.

If I may defend rcrsn51's comments - maybe he feels as I do, that Puppy has allowed "free-thinkers" to compute the way they want to, without adhering to external "standards".

Windows has its own approach to "standards" - it is a quicksand.
Mac imposes it's own standards - it opposes individuality.
Puppy sets me free - I choose what I want to do. (Thanks Barry!)

I understand why the Hostname issue must be adressed, but I also understand why some feel that they do not want to see Puppy become subservient to other peoples rules.

You have said "I have never subscribed to the "every man (application) for himself" in systems development"

I have a different view.

Independence is what made puppy useful for me.

Please do not shackle Puppy to those who invented TCP/IP and other network "standards". Such people work for defence forces and governments.

They understand centralised control, and subjugation of the individual.

Ok, lets improve any faults within Puppy, but without having to force Puppy users to conform.

gcmartin

#33 Post by gcmartin »

Thanks @greengeek for your comments.

I agree with you about the freedom to create without shackles. This thread is NOT about shackling anything.

Its about your Puppy Linux system operation and its about your LAN operation.

As I remember, @Rcrsn51 (whom I regard highly for the many many contributions he makes. Whenever he says something I listen. ) did NOT come out with concerns about Puppy freedom, his concern was about whether there is harm in leaving the problem built into Puppy. Further scrutiny shows that there is harm when hostname fields do not agree. This thread's contributions have resolved that concern for all of us.

Linux is a system. Its not a single program. Its applications and services, that run, expect a certain set of standards for it to integrate and to operation politely.

This thread's discussion and its solution is about just that. Not being shackled as you infer, but about providing a standard set of services to allow your PC to operate politely; internally and externally. This gives us the freedom to do all kinds of things while the underlying system insures proper operations for us.

Further as is noted by Shinobar's and by Tazoc's efforts, it provides you, the user, the ability to freely select in such a way to maintain stability and polite executions internally and externally.

Please understand this this is and was NOT a personal crusade. It was about bringing awareness to resolving a problem.

You now will be able to have your system experience the benefits provided by the contributions you find from this thread. I do NOT take credit for this solution. The contributors are my heroes for their recognitions and addresses they provide us.

Timeline:
  1. 01Micko recognize this anomaly several years ago and started work but never revisited it
  2. Shinobar added hostname to FirstRUN, last year to make it easy and conscious
  3. TaZOC was the first implementation that successfully managed all internal Puppy fields updating via Personalized Settings wihtout desktop shutdown
  4. 01Micko revisited his work and gave us the OTB boot-time hostname update to handle the system fields so that when the Live media boots to desktop, all fields would agree and LAN behavior would not conflict
  5. Barry embraced 01Micko's work in WOOF because it makes sense to address this.
Thus, now every distro maker can benefit from everyone's contributions here. And further, every user of Puppy distros will benefit from everyone's contribution. Not one of these contributors are doing anything except addressing proper system behavior.

Also, because of Puppy's design, if you are not happy with this work by the contributors, anyone may, either use Shinobar's FirstRUN and reset all of your Puppy PC names to the same (in violation of what every instructor and LAN administrator on the planet teaches) or you may modify your Puppy to pull out the harmless additions everyone has contributed for you.

So, I hope you understand and see that this thread's contribution is NOT about conformity. But, it is about correcting an overlooked "fault".

The intent here is to make a great distro. That means all the necessary tests to be called a great OS is in its behavior on the desktop, within the LAN and within the WAN.

This thread is a very very small step to go along with ALL of the small steps as Puppy matures. And it is maturing very, very rapidly! I have written before about some of the great contributions made over the past 12-18 months in this community. These have been game changers that are part of the maturation we are witnessing. It's making newbie use as well as season veteran use, a breeze for the well thought thru solutions provided for all of us. Heck we can now run 32bit Puppy flavors on PCs utilizing up to 64GB of RAM, today, on a LiveCD. This was unheard of a year ago. Puppy is maturing in ways and at rates that other mainstream distros cannot.

Question for anyone
Please point out how the hostname resolutions instituted, have a negative impact on a user's creativity? Has this thread given the appearance that creativity is in peril?

Acknowledgements
I don't think I have done this until now, but I want to thank everyone who has responded to this thread. Collectively, you have made this problem understood and resolved. Thanks EVERYONE!

Hope his helps

gcmartin

Solved

#34 Post by gcmartin »

There are 2 elements to this problem. First, what happens when ANY PUP is booted for first-tiime from LiveCD or Netboot (pfix=ram). Next, a tool to assist changing the hostname after the system reaches desktop.

Solved by Barry's incorporation into WOOF for base ISOs built. The base allows all PUP LIveCD/ISO to boot with a unique, out-of-the-box (OTB) LAN hostname with all internal Puppy subsystems files consistent with that host's name.

The following distros ALSO employs Shinobar's Personlaize Seettings (FirstRUN) in such a way that when anyone changes the hostname field in Personalize Settings, all proper Puppy files and fields are correspondingly updated as wel without ANY user needing to "restart the desktop" or "logout at Ctrl-Alt-F1 prompt" or "save-session+reboot"l:
  • TaZOC has solved this in LightHouse64
  • 01Micko has solved this in SLACKO
Hope this helps all distro builders.
Attachments
3 PCs on a LAN.png
External view of an Example LAN
(92.39 KiB) Downloaded 643 times
Last edited by gcmartin on Sun 21 Aug 2011, 18:38, edited 4 times in total.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#35 Post by amigo »

BTW, I don't think anyone ever explained why the hostname would make rox slow. It's because rox can transparently handle NFS-mounts (and maybe other network mounts) -FWIW.

Post Reply