You are not logged in.

#1 2009-11-19 17:26:01

Vunovati
Member
From: Zagreb, Croatia
Registered: 2009-08-04
Posts: 6

[SOLVED partialy]Networkmanager modifies my /etc/hosts after login

Hi!
I have a strange problem with networkmanager

It changes my computer's hostname to "localhost" by modifying my /etc/hosts file


here it is:

[ovca@localhost ~]$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
127.0.0.1    localhost.lan    localhost.localdomain    localhost

#<ip-address>    <hostname.domain.org>    <hostname>

# End of file
127.0.0.1 livada # added by Apache Friends XAMPP

I want my hostname to be "livada" so I modified it accordingly

[ovca@localhost ~]$ cat /etc/hosts
#<ip-address>    <hostname.domain.org>    <hostname>

# End of file
127.0.0.1 livada # added by Apache Friends XAMPP

After reboot, computer asks me to enter my livada login:
i enter and then it then prompts me to:
ovca@localhost

Again my cat /etc/hosts  says

[ovca@localhost ~]$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
127.0.0.1    localhost.lan    localhost.localdomain    localhost

#<ip-address>    <hostname.domain.org>    <hostname>

# End of file
127.0.0.1 livada # added by Apache Friends XAMPP

It all began an hour ago when I replaced Wicd with networkmanager (becouse i couldnt get an IP from my colledge wireless network's DHCP) I followed this tutorial: http://wiki.archlinux.org/index.php/NetworkManager

(yes, my rc.config

HOSTNAME="livada"

)

Any suggestions? This is frustrating smile

Last edited by Vunovati (2009-12-01 02:23:07)


Arch + awesome + urvxt

Offline

#2 2009-11-19 17:49:17

Vunovati
Member
From: Zagreb, Croatia
Registered: 2009-08-04
Posts: 6

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

Ok, now I modified my /etc/hosts to
127.0.0.1 livada

And made it immutable
sudo chattr +i /etc/hosts

as suggested in:
http://ubuntuforums.org/showthread.php?t=554771

But, still no progress
My hostname is still localhost, and I can do nothing about it hmm

So maby the problem is not in /etc/hosts but in something else

Suggestions?
Help please smile


Arch + awesome + urvxt

Offline

#3 2009-11-19 17:53:46

MadTux
Member
Registered: 2009-09-20
Posts: 553

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

Did you set the same hostname in

/etc/NetworkManager/nm-system-settings.conf

Reference:
http://wiki.archlinux.org/index.php/Net … t_hostname

Last edited by MadTux (2009-11-19 17:54:34)

Offline

#4 2009-11-19 18:01:49

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

are you sure that is networkmanager? what about the comment # added by Apache Friends XAMPP ?


Give what you have. To someone, it may be better than you dare to think.

Offline

#5 2009-11-19 18:02:06

Vunovati
Member
From: Zagreb, Croatia
Registered: 2009-08-04
Posts: 6

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

MadTux wrote:

Did you set the same hostname in

/etc/NetworkManager/nm-system-settings.conf

Reference:
http://wiki.archlinux.org/index.php/Net … t_hostname

Yes, I forgot to mention

[main]
plugins=keyfile

[keyfile]
hostname = livada
wonder wrote:

are you sure that is networkmanager? what about the comment # added by Apache Friends XAMPP ?

Removed it, but still no luck, I guess it was just a comment smile

Any ideas where else could I look or modify my hostname?

Last edited by Vunovati (2009-11-19 18:10:41)


Arch + awesome + urvxt

Offline

#6 2009-11-19 18:15:05

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

is not a simple comment. its says that xampp added that line there smile

look at the messages when you starting xampp you'll see something like:

XAMPP: Your /etc/hosts is not okay. I will fix it.

P.S you might want to fix your /etc/hosts. this is not valid

127.0.0.1    localhost.lan    localhost.localdomain    localhost

Last edited by wonder (2009-11-19 18:16:00)


Give what you have. To someone, it may be better than you dare to think.

Offline

#7 2009-11-19 18:36:18

Vunovati
Member
From: Zagreb, Croatia
Registered: 2009-08-04
Posts: 6

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

wonder wrote:

is not a simple comment. its says that xampp added that line there smile

look at the messages when you starting xampp you'll see something like:

XAMPP: Your /etc/hosts is not okay. I will fix it.

P.S you might want to fix your /etc/hosts. this is not valid

127.0.0.1    localhost.lan    localhost.localdomain    localhost

Okay, I removed everything. now i'm just left with

 127.0.0.1 livada

as it is supposed to be I guess hmm

Still my login name doesn't change

Also if i leave my /etc/hosts without immutating it, something adds a line

127.0.0.1    localhost.lan    localhost.localdomain    localhost

at the beginning of the file.


Where else can I configure my hostname ? hmm

Last edited by Vunovati (2009-11-19 19:26:40)


Arch + awesome + urvxt

Offline

#8 2009-11-19 18:37:43

MadTux
Member
Registered: 2009-09-20
Posts: 553

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

wonder wrote:

is not a simple comment. its says that xampp added that line there smile

look at the messages when you starting xampp you'll see something like:

XAMPP: Your /etc/hosts is not okay. I will fix it.

P.S you might want to fix your /etc/hosts. this is not valid

127.0.0.1    localhost.lan    localhost.localdomain    localhost

I guess, thats the problem here. In his inital post he says that something is modifying /etc/hosts.

Offline

#9 2009-11-19 18:41:10

MadTux
Member
Registered: 2009-09-20
Posts: 553

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

Vunovati wrote:

Okay, I removed everything. now i'm just left with

 127.0.0.1 livada

as it is supposed to be I guess hmm
hmm

My /etc/host looks like this

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    localhost D5150

# End of file

Where D5150 is my hostname.

Offline

#10 2009-11-19 18:43:29

llcawthorne
Member
From: Columbia, SC
Registered: 2009-10-16
Posts: 142

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

You probably don't want to remove 'localhost' from your hosts file.  From the "Beginner's Guide":

Note: This format, including the 'localhost' and your actual host name, is required for program compatibility! So, if you have named your computer Archhost, then that line above should look like this:

127.0.0.1   localhost.localdomain   localhost livada

Man.  MadTux just beat me to practically the same thing.  Heh.  Hope it helps!

Last edited by llcawthorne (2009-11-19 18:44:31)


To understand recursion, you must understand recursion.

Offline

#11 2009-11-19 18:47:35

MadTux
Member
Registered: 2009-09-20
Posts: 553

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

llcawthorne wrote:

You probably don't want to remove 'localhost' from your hosts file.  From the "Beginner's Guide":

Note: This format, including the 'localhost' and your actual host name, is required for program compatibility! So, if you have named your computer Archhost, then that line above should look like this:

127.0.0.1   localhost.localdomain   localhost livada

Man.  MadTux just beat me to practically the same thing.  Heh.  Hope it helps!

Yes, man , i am reaaaallly fast in typing.

Offline

#12 2009-11-19 19:22:54

Vunovati
Member
From: Zagreb, Croatia
Registered: 2009-08-04
Posts: 6

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

MadTux wrote:
Vunovati wrote:

Okay, I removed everything. now i'm just left with

 127.0.0.1 livada

as it is supposed to be I guess hmm
hmm

My /etc/host looks like this

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    localhost D5150

# End of file

Where D5150 is my hostname.

Yep, I did it the way you told me

What i get now is:

#
# /etc/hosts: static lookup table for host names
#
127.0.0.1        localhost.localdomain    localhost 
#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    localhost livada

# End of file

if I delete

127.0.0.1        localhost.localdomain    localhost

and Immute the file with

sudo chattr +i /etc/hosts

after I reboot
it remains:

#
# /etc/hosts: static lookup table for host names
#
#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    localhost livada

# End of file

But still, i end up with ovca@localhost sad


Arch + awesome + urvxt

Offline

#13 2009-12-01 02:26:15

Vunovati
Member
From: Zagreb, Croatia
Registered: 2009-08-04
Posts: 6

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

Anyway I must say that I gave up on networkmanager. Now I simply use dhcpd wlan0 to connect anywhere, the arch way big_smile

The solution to networkmanager changing my config file was to make it immutable as described above wink


Arch + awesome + urvxt

Offline

#14 2010-01-07 23:44:33

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [SOLVED partialy]Networkmanager modifies my /etc/hosts after login

Vunovati wrote:

After reboot, computer asks me to enter my livada login:
i enter and then it then prompts me to:
ovca@localhost

Again my cat /etc/hosts  says

[ovca@localhost ~]$ cat /etc/hosts

Interesting though that /etc/hosts has nothing to do with the host name being shown at your login or shell prompt. Your host name is set by the "hostname" command, or in /proc/sys/kernel/hostname.

Offline

Board footer

Powered by FluxBB