Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 24 Nov 2014, 11:18
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
hostname and hostname -f don't match
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
go2null

Joined: 23 Oct 2011
Posts: 11

PostPosted: Sat 30 Mar 2013, 01:57    Post subject:  hostname and hostname -f don't match
Subject description: Bug in /usr/sbin/hostname-set causes hostname -f to not match hostname
 

This bug existed at least since the first commit to Woof of usr/sbin/hostname-set.

Bug exists as the canonical_hostname should be listed first, then aliases. [man hosts]
Bug:
Code:
75    echo "127.0.0.1 localhost $NEW_HOSTNAME"  > /tmp/hostname-set-hosts

Fix:
Code:
75    echo "127.0.0.1 $NEW_HOSTNAME localhost" > /tmp/hostname-set-hosts


I've opened a defect on Google Code.

[EDIT] Fixed typos
[EDIT] Added cause of bug, thanks to Karl Godt for the pointer.
[EDIT] Added link to Puppy Bug Tracker on Google Code.

Last edited by go2null on Sat 30 Mar 2013, 14:42; edited 2 times in total
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Sat 30 Mar 2013, 03:19    Post subject:  

Quote:
Example

127.0.0.1 localhost
192.168.1.10 foo.mydomain.org foo
192.168.1.13 bar.mydomain.org bar
146.82.138.7 master.debian.org master
209.237.226.90 www.opensource.org

http://linux.die.net/man/5/hosts
Quote:
For each host a single line should be present with the following information:

IP_address canonical_hostname [aliases...]

Fields of the entry are separated by any number of blanks and/or tab characters. Text from a "#" character until the end of the line is a comment, and is ignored. Host names may contain only alphanumeric characters, minus signs ("-"), and periods ("."). They must begin with an alphabetic character and end with an alphanumeric character. Optional aliases provide for name changes, alternate spellings, shorter hostnames, or generic hostnames (for example, localhost).

Slightly confusing the above . Dunno if localhost is the alias or the canonical name .
That puppypc12345 would be the canonical one, would mean canonical in the local network.
Since the above examples are like
192.168.1.10 foo.mydomain.org foo
and not
192.168.1.10 foo foo.mydomain.org

I doubt that your are right in this regard.
That your are false in posting to the Desktop section and also false not posting in the Bug section , that's for sure.
May I ask what your knowledge background is ?

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send private message Visit poster's website 
go2null

Joined: 23 Oct 2011
Posts: 11

PostPosted: Sat 30 Mar 2013, 14:18    Post subject:  

@Karl: Thanks for the link. I didn't think of looking up the man page, as the issue seems fairly obvious.

However, the man page explains the bug. Namely, that the canonical_hostname should be listed first, then aliases.

Further, the man page, in the section that was quoted, even cites localhost as an example of an alias.

Quote:
Optional aliases provide for name changes, alternate spellings, shorter hostnames, or generic hostnames (for example, localhost).


WRT posting in the wrong forum, my apologies. I was reading WOOF version - QuickSETUP-FirstRUN "Personalize Settings"Bug as part of my research and just clicked on new topic without checking the forum. (I also got sidetracked as I had to reset my password - this is my 2nd post since joining the forum 2 years ago.) Hopefully a moderator will move to the appropriate forum.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Sun 31 Mar 2013, 00:59    Post subject:  

I have no local network, so cannot make exercises about this.
I did set the hostname so it shows up as prompt with
hostname Abracadabra
PS1='\H # '
in an older Puppy, which seems not to care about any configuration files.

But in my newer racy_5.1.x busybox hostname complains when called with the -s option. Has to be set in /etc/hosts too, and it should be as you describe it :
Code:
puppypc4427 # hostname Abracadabra
puppypc4427 # PS1='\H #'
puppypc4427 #
puppypc4427 #hostname -s
hostname: Abracadabra: Unknown host
puppypc4427 #cat /etc/hostname
puppypc4427
puppypc4427 #echo Abracadabra>/etc/hostname
puppypc4427 #hostname -s
hostname: Abracadabra: Unknown host
puppypc4427 #cat /etc/hosts
127.0.0.1 localhost puppypc4427

changed puppypc4427 to Abracadabra in geany editor
Code:
puppypc4427 #hostname -s
localhost
puppypc4427 #PS1='\H # '
puppypc4427 #

opened another console:
Code:
# PS1='\H # '
Abracadabra # hostname -s
localhost
Abracadabra #

looks like bash and busybox have different opinions about it Smile
Back to top
View user's profile Send private message Visit poster's website 
go2null

Joined: 23 Oct 2011
Posts: 11

PostPosted: Wed 11 Dec 2013, 14:01    Post subject:  

Patch submitted to GitHub woof-CE.
https://github.com/puppylinux-woof-CE/woof-CE/pull/156/files
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Wed 11 Dec 2013, 18:32    Post subject:  

This isn`t the forum for this subject. This is add-on software.

Not bug reports or cutting edge development. Wink
Back to top
View user's profile Send private message 
go2null

Joined: 23 Oct 2011
Posts: 11

PostPosted: Mon 16 Dec 2013, 12:46    Post subject:  

sunburnt wrote:
This isn`t the forum for this subject. This is add-on software.


Understood and agree. Please see my note above:
Quote:
WRT posting in the wrong forum, my apologies. [...] Hopefully a moderator will move to the appropriate forum.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0641s ][ Queries: 12 (0.0047s) ][ GZIP on ]