HOSTNAME fixes ROX slowness problem - SOLVED

Using applications, configuring, problems
Message
Author
gcmartin

HOSTNAME fixes ROX slowness problem - SOLVED

#1 Post by gcmartin »

Many will find this complex. Many will find this complicated. Some will find it challedging, but together, I think this community can address this to a very High degree of resolution that will survive future Puppy and kernel upgrades. Externally, there appears to be a problem with Puppy design.

I expect that Objections will be heard within the community

This post is structured as follows;
  1. History of HOSTNAME
  2. History of the "hostname - ROX - "Puppy-Linux filesystem" problem
  3. Current status
  4. The Problem
  5. Request for community assistance
History of HOSTNAME
Without boring anyone, I wll summarize. Since the middle '70, ALL communications and later LAN administrators have been taught that they will never be two devices on the LAN with
  • same MAC
  • same hostname
  • same IP address
These identify the "machine-readable ID" as well as the "machine-readable name" of every device on the LAN. Every LAN technician who was ever taught by anyone, anywhere, knows to NOT make the mistake of duplicating this information on ANY two PC on a local LAN.in the same subnet.

These items, it is taught, is a standard that we are suppose to abhere to. And there are many very, very good reasons this is done. The standard says, "Every device will have a unique one of each of these."

Puppy/WARY have long been approaching the LAN as if it is the ONLY PC on the LAN, and that the Puppy PC will use its NIC to traverse the LAN to enter and use the internet.

Over the years, many of us have sort and used PUPs on our LAN where there are other PCs. Most recently, now, many of us are beginning to populate our LANs with multiple PUPs.

Even though the MAC are unique, the hostname(s) are NOT UNIQUE. And, in many cases they are the same for multiple Puppy devices on you LAN. This defies architectural standards defined and causes issues on the local PC and local LAN. Many non-PUP distros handle effectively.handled this problem with the hostname management withn their distros; namely Ubuntu, Fedora, Suse, etc.

In Puppy, this appears, that it was never revisited until fall,2010 when Shinobar step forward and began offering a solution that has been adopted by several distro developers here for other reasons, than the one we are discussing here.

History of the " 'hostname' - 'ROX' - 'Puppy-Linux filesystem' " problem
Almost simultaneous with Shinobar's solution, a discovery was made that there was a "LINK" to the /etc/hosts file contents and the behavior of the Puppy filesystem when using ROX. Seems that there is a slowness/delay in ROX behavior on the desktop when this file is NOT set properly. Again, Shinobar, enters the arena and upgrades his tool to overcome this delay problem by insuring that the hostname and the /etc/hosts contains the proper information which removes the delay/slowness we all had had for years with Puppy and ROX.

Now, as nice of a solution that Shinobar presents with the tool he developed for this community, if a savvy Linux user(s) did NOT use his tool, and tried to manually makes some needed changes to the system by modifying some key files or system variables, he runs the risk of filesystem things not working properly.

Current status
Today, no Puppy I have found is delivered with tools necessary to change "ALL" related system variables when the hostname is changed in the system. Nor, is there any directions for addressing how to get hte system to conform so that filesystem performance matches what an OTB filesystem provides in its ROX speed and performance.

The Problem:
In any Puppy system, the following PUPPY System data does NOT agree
when ANY changes to the following is necessary
  • hostname from the Linux hostname command
  • Linux Environment Variable HOSTNAME
  • files
    • /etc/hosts
    • /etc/hostname
Why is this a problem?
This is system data. And from time to time various application rely on getting authoritative data from the system's files and variables. This information should and must be kept consistent.
  1. All of these system items should agree when a user begins to use the Puppy desktop and wants to use his machine for ANY LAN operation
  2. All of these items should agree when a user has a need to change the system's hostname for ANY reason.
Important NOTE
It seems that when the fields agree, for some unknown reasons, ROX in PUPs seems to have superior performance than when these fields do NOT agree.

Request for community assistance
Would anyone, anyone share any thoughts on
  • why this dilemma exist in Puppy design?
  • what would be the "right" place for a solution to be for distro builders?
  • What should the solution look like?
  • What should be an acceptable Puppy methodolgy for changing the system hostname
  • when its necessary to do so?
I fully recognize that this topic is a little difficult for some to try to grasp what's going on, here, but many of the develpers in this community fully realize what's happening.

Please help all of us on this if you can.
P.S. PLEASE understand that the hostname may need to be changed when there is need after the system may have been running for awhile. We should expect that the system administrator can/will at any time change the system hostname to match LAN needs.
Last edited by gcmartin on Fri 19 Aug 2011, 15:22, edited 2 times in total.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#2 Post by 8-bit »

I have been with Puppy for a while, and with a local home lan with wireless as well as wired and Puppy on my main PC as well as on a few laptops that connect wirelessly, I can see that having a few PCs with the name "PuppyPC" could prove to be a problem.
Why can't one just implement startup code that asks what the user wants to name his PC?
It would then change all needed data accordingly.
A utility could also be added under networking to change the name later.

Also, my Lan keeps info for every PC that uses it for future connections.
I had to connect a laptop wired to set up a router.
When I later tried to connect the same laptop wirelessly, I had problems as the router assumed the laptop was still hardwired.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#3 Post by bigpup »

In Lucid Puppy 5.2.5
Personalize Settings
Has option to change hostname
Doesn't this do what you are looking for?
Attachments
personalize settings.jpg
(52.97 KiB) Downloaded 2591 times
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#4 Post by nooby »

This maybe explain then why some people have problems with wifi set up?
If the router remember another setup with same hostname?

Just me wild guessing. I've only set up wifi with smartphones.
the hostname may need to be changed when there is need after the system may have been running for awhile. We should expect that the system administrator can/will at any time change the system hostname to match LAN needs.
BigPup so in Pup 525 one go to that personal set up and change it then.

What does one do in other puppies?
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
Terryphi
Posts: 761
Joined: Wed 02 Jul 2008, 09:32
Location: West Wales, Britain.

#5 Post by Terryphi »

gcmartin: I don't quite understand why this is a problem. I have 2 PCs on my LAN and my router knows them by the name of the user (e.g. Jack-PC and Jill-PC). On these PCs I can run any OS (Windows, various Puppy variants, Ubuntu and Linux Mint) with any hostname and they connect without problem. Does your router not allow you to rename attached devices?

Are you saying that Puppy works in a fundamentally different way from other Linux distros where changing the hostname is simply a matter of editing /etc/hosts and then everything just works on reboot?

Using a wireless network can be more complicated for the reason described above by 8-bit. How important is hostname anyway? Surely the router is only interested in the names of the attached devices (which can be changed within the router settings)?
[b]Classic Opera 12.16 browser SFS package[/b] for Precise, Slacko, Racy, Wary, Lucid, etc available[url=http://terryphillips.org.uk/operasfs.htm]here[/url] :)

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#6 Post by nooby »

Terry wrote
Jack-PC and Jill-PC
As I get it some puppy automatically for to be able to boot give all "hosts" the same name puppypc

So I trust that is what gcmartin experienced and now him ask us for a solution to.

More modern versions like Puppy 5.2.5 does allow one to change that name before activating wifi?

But i don't trust that a noob would know one need to change that name.

I 've booted Puppy for some three years daily using it 24/7 and I've never once though about hostname and the word host I thought was only used by wmware and vbox.

I know from experience that internal hardisk can have a UUID Label?
but also have a human chosen label but I had no idea that one needed to name the pc as such.

I would bark loud if some software asked me to give that name and I would not know that it is named puppypc by default. I am that stupid
I use Google Search on Puppy Forum
not an ideal solution though

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

#7 Post by 01micko »

gcmartin

I see your point and I propose a simple solution.

/etc/hosts and /etc/hostname are hard coded into the puppy iso. Therefore when when the environment variable $HOSTNAME is run it's going to be "puppypc" until a reboot. Environment variables are set up by the script /etc/profile at boot. At very first boot we need to run something that sets a new hostname before that is run.

Now, immediately before /etc/profile is run /etc/rc.d/rc.sysinit is run and that seems to depend on /etc/hostname's existence.

@ line 376 /etc/rc.d/rc.sysinit

Code: Select all

hostname -F /etc/hostname
I propose that /etc/hostname and /etc/hosts should not exist hard coded in the iso but created with a random number:

Code: Select all

if [ ! -f /etc/hostname ];then echo "puppypc${RANDOM}" > /etc/hostname
 PUPHOSTNAME=$(cat /etc/hostname)
  echo "127.0.0.1 localhost $PUPHOSTNAME
192.168.1.1 pc2
192.168.1.2 pc3
192.168.1.3 pc4" > /etc/hosts
fi
This assigns a random number appended to "puppypc" inserting it into /etc/hostname (if it doesn't already exist) and then creates a minimal /etc/hosts file. As long as this happens before line 376 in /etc/rc.d/rc.sysinit it should be sweet and our environment variable $HOSTNAME should be fine too.

Bear in mind this is untested, just off the top of my head but I have thought of this before as I have had issues with 2 puppy pc's on the LAN.
Puppy Linux Blog - contact me for access

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#8 Post by jamesbond »

/etc/hostname is used to set kernel's hostname during system boot-up. The code is in rc.sysinit.
/etc/hosts is used to translate a name to an IP address.
They serve two different purposes and generally they don't have to match. But it's good to ensure that system's hostname is resolvable to an IP address.
In Fatdog64, during creation of the save file the system will ask you (optionally) change the default hostname ("fatdog64") to something else.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#9 Post by jamesbond »

01micko wrote: I propose that /etc/hostname and /etc/hosts should not exist hard coded in the iso but created with a random number:
Excellent suggestion ! Image
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#10 Post by rcrsn51 »

Correct me if I'm wrong, but the hostname is only important if the computer is running a service that advertises the name over your network. In how many Puppy situations does that occur? I can only think of one and it is easily resolvable.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#11 Post by jamesbond »

rcrsn51 wrote:Correct me if I'm wrong, but the hostname is only important if the computer is running a service that advertises the name over your network. In how many Puppy situations does that occur? I can only think of one and it is easily resolvable.
hostname uniqueness is important if the machine is to be accessible by its name over the network (basically, when the machine is acting as a server - web server, ftp server, nfs server, samba server (file sharing), etc).
But making hostname translate-able to IP address is important because some applications (apparently ROX included - though I don't understand why a file manager needs this) uses networking to connect to other components - even on the same machine. In this case, it is used only locally within the same machine, duplicate hostnames isn't a problem.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#12 Post by rcrsn51 »

jamesbond wrote:hostname uniqueness is important if the machine is to be accessible by its name over the network (basically, when the machine is acting as a server - web server, ftp server, nfs server, samba server (file sharing), etc).
That's certainly true for a Samba server. But do Puppy ftp and web servers broadcast their ID name? And if so, do they use the machine's hostname by default?

Seeing how people have been using Puppy networks for years where all the machines are named "puppypc", I am having trouble understanding the practical significance of this issue.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#13 Post by rcrsn51 »

01micko wrote:I propose that /etc/hostname and /etc/hosts should not exist hard coded in the iso but created with a random number
Imagine a home network where each machine was running a Samba server identified by a random string of digits. How would you find anybody's shares?

You would still have to rename each machine to something meaningful, which is what you have to do now with "puppypc".
Last edited by rcrsn51 on Fri 01 Feb 2013, 19:31, edited 1 time in total.

gcmartin

#14 Post by gcmartin »

This is indeed, a system level change requirement.

@01Micko proposes an acceptable solution for OTB Live media booting and beyond. This would create and preserve uniqueness for each and every use of the Live media boot process.

@JamesBond accurately indicates some cautions that should be understood and abhered to. The ROX problem is tied to the hostname, somewhere somehow and appears to maybe make use of couple of the 4 fields in its operation. When ROX is getting compatible information, processing speeds. When it doesn't, processing slows in its presentation on desktop.

@Rcrsn51 seems focused merely on SAMBA, yet I have repeated said ROX as well.

AND, how many of us know if there are other apps who would experience improved behavior it the Puppy system would be in agreement of these fields.

I believe that the correct approach is to have all the fields consistent for any internal system application's use. All internel applications should, at the very least, be seeing the system name consistently whenever they use any of these system fields, NOT as it is today. These are NOT application owned setting....these are system level settings.

So any solutions addressed will benefit all of us in our use of Puppy, internally for local applications and externally when the hostname is advertised appropriately.

gcmartin

#15 Post by gcmartin »

@Terryphi, Thanks for asking. You are helping all of us to see the problem thru your questioning like this.
Terryphi wrote: ... I don't quite understand why this is a problem. ... Does your router not allow you to rename attached devices?
Routers do NOT change the hostname of PCs. All PCs can present their hostname and the router can registers that hostname. Its a problem because NO 2 PCs will have the same IP address, nor the same MAC address, nor the same Hostname. Its LAN architecture rules that we are suppose to follow.
Terryphi wrote: Are you saying that Puppy works in a fundamentally different way from other Linux distros where changing the hostname is simply a matter of editing /etc/hosts and then everything just works on reboot?
Yes! Linux hostname changes are typically done using the Linux command "hostname". Puppy does this too, but the other system fields are not touched when the root user (administrator) uses the hostname command changes the system name. Some of the other Linux distros have solve this problem.
Terryphi wrote: Using a wireless network can be more complicated for the reason described above by 8-bit. How important is hostname anyway? Surely the router is only interested in the names of the attached devices (which can be changed within the router settings)?
Your router is NOT concerned about hostname UNLESS it is doing DNS services for your local LAN. Most routers purchased from stores thruout the world do NOT provide that feature.

And yes, hostname is important if we are to continue to follow LAN architectural rules. We did NOT make the rules, but there are some very very good reasons why these kinds of rules exist...even on your loacl LAN.

Hope this helps

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#16 Post by rcrsn51 »

gcmartin wrote:@Rcrsn51 seems focused merely on SAMBA, yet I have repeated said ROX as well.
Let me make my point again. The current situation, where "puppypc" is used everywhere in the machine, works perfectly well. It only becomes an issue when you start changing the hostname. If a Samba or web server needs to broadcast a name, that name can be easily declared in its own configuration.

IMHO, there is no practical need to do anything else. Other than adhering to some conventional wisdom about hostnames, what is the advantage to changing the status quo?

gcmartin

#17 Post by gcmartin »

As we are progressing thru this discussion, I think it may be important to note the following;
Puppy has become (in my mind) a major OS. But its a little different in its implementation.

ALL other major OSes are geared toward HDD installation. Puppy has brought to the table a system which is RAM + LIve Media based. So how this hostname issue is handled from the major OS standpoint is a little different than how it may get addressed in PUPPYland

Microsoft, AIX, HPUX, RedHAT, Suse, Ubuntu, etc all ask at system installation time what the system name (HOSTNAME) is to be, then they set all appropriate fields accordingly. 01Micko+JamesBond has suggested options that this be set during Live media boot or at Live media shutdown. (Boot may be a preferred method with preservation at shutdown)

All magor OSes seem to have "hooked/hacked/made adjustments" in hostname processing so that when the hostname function is activated by the roor user to change the system's hostname, all of the sytem's fields are immediately updated accordingly. This is why we are engaged in this discussion. How should we get this OS, Puppy, to do this accordingly too.

So we, here, are talking about 2 issues.
  1. The hostname command processing in Puppy
  2. the system fields affected by hostname command use.
Hope this helps

gcmartin

#18 Post by gcmartin »

rcrsn51 wrote:[ ... Other than adhering to some conventional wisdom about hostnames, what is the advantage to changing the status quo?
To be perfectly clear is to ignore this problem area? No disrespect, but, I hope this is not what you are advocating. Further, we are NOT changing status_quo. This thread is about a problem area in PUPPY. Not status-quo.

I have never subscribed to the "every man (application) for himself" in systems development. I have found it better to solve things that are good for everyone at the sytem level.

You are already aware of the ROX problem.

The advantage is "consistent system information" for all internal applications use. We do NOT have that today. We have inconsistent information in the system.

I have NOT suggested that this is a high priority problem in thet system operation will stop. ROX might not perform optimumly or some other application may read inconsistent information. But, It is not going to magically disappear. Its needs some of our attention.

Hope this helps

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#19 Post by rcrsn51 »

gcmartin wrote:I have never subscribed to the "every man (application) for himself" in systems development. I have found it better to solve things that are good for everyone at the sytem level.
And I subscribe to the philosophy that the simplest solution is usually the best. You want to change the identifier in several locations, requiring a bunch of code. I want to change the identifier in one location, requiring no additional code.

Both methods would get you effectively the same result.

gcmartin

#20 Post by gcmartin »

rcrsn51 wrote:
gcmartin wrote:I have never subscribed to the "every man (application) for himself" in systems development. I have found it better to solve things that are good for everyone at the sytem level.
And I subscribe to the philosophy that the simplest solution is usually the best. You want to change the identifier in several locations, requiring a bunch of code. I want to change the identifier in one location, requiring no additional code.

Both methods would get you effectively the same result.
Then, I think my friend we agree that something should be done, effectively. Thanks for clarifying that.

Although, I still don't understand how you get something for nothing. Are you offering a fix for this that we missed. How can you fix the hostname command to bring the system files into consistency? Can you share how you would do this?

In the opening thread, I ask for consideration at the botton of that thread. Can you help with any of those 5 items?

Thanks in advance.

Post Reply