Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Periodically changing hostname
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Tsynique
n00b
n00b


Joined: 17 Aug 2011
Posts: 7

PostPosted: Thu Aug 18, 2011 2:32 pm    Post subject: [SOLVED] Periodically changing hostname Reply with quote

Hello,

I'm dealing with this problem for a few days now. When Gentoo boots up, the hostname is set to 'localhost'. When wicd finishes connecting to a network (wired or wireless), the hostname changes to 'new-host'. This I managed to fix by adding a script
Code:
hostname `cat /etc/hostname`
to all wicd script directories. However, after using the system for some time, the hostname changes on it's own again. First to 'new-host' then 'new-host-2', 'new-host-3', etc. I don't like this and really want to fix it but after googling and trying a number of solutions, nothing worked. Please help.
Here is my /etc/hostname and /etc/dnsdomainname:
Code:
localhost

/etc/hosts
Code:
127.0.0.1   localhost
::1      localhost

Also the hostname daemon is added to rc:
Code:
# rc-update show
             bootmisc | boot                         
                 dbus |      default                 
                devfs |                       sysinit
                dmesg |                       sysinit
                 fsck | boot                         
             hostname | boot default                 
              hwclock | boot                         
              keymaps | boot                         
            killprocs |              shutdown       
                local |      default                 
           localmount | boot                         
              modules | boot                         
             mount-ro |              shutdown       
                 mtab | boot                         
               net.lo | boot                         
             netmount |      default                 
               procfs | boot                         
                 root | boot                         
            savecache |              shutdown       
                 swap | boot                         
               sysctl | boot                         
            syslog-ng |      default                 
         termencoding | boot                         
                 udev |                       sysinit
       udev-postmount |      default                 
              urandom | boot                         
                 wicd | boot                         
                  xdm |      default

BTW, when upgrading to kernel 3.0.3 I changed the default hostname to 'localhost' in menuconfig.


Last edited by Tsynique on Fri Sep 23, 2011 11:24 am; edited 1 time in total
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5910

PostPosted: Thu Aug 18, 2011 2:58 pm    Post subject: Reply with quote

why wicd is placed in boot? afaik, all network related should be in default.

also, why hostname is in both boot and default?

leave it on boot only.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
dwbowyer
Apprentice
Apprentice


Joined: 18 Apr 2008
Posts: 155

PostPosted: Thu Aug 18, 2011 10:32 pm    Post subject: Re: Periodically changing hostname Reply with quote

I don't use wicd, so I can't answer anything directly about that. But:

Tsynique wrote:

/etc/hosts
Code:
127.0.0.1   localhost
::1      localhost



Why not change that to:
/etc/hosts
Code:
127.0.0.1   <long.host.name> <shortname> localhost
::1      localhost



EDIT:
hostname --help wrote:

This command can read or set the hostname or the NIS domainname. You can
also read the DNS domain or the FQDN (fully qualified domain name).
Unless you are using bind or NIS for host lookups you can change the
FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
part of the FQDN) in the /etc/hosts file.
Back to top
View user's profile Send private message
Tsynique
n00b
n00b


Joined: 17 Aug 2011
Posts: 7

PostPosted: Fri Sep 23, 2011 11:24 am    Post subject: Reply with quote

Solved by changing hostname to "myhost". Helpful command to so:
Code:
find /etc -type f | xargs grep "localhost"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
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