LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   -current changing hostname (https://www.linuxquestions.org/questions/slackware-14/current-changing-hostname-942003/)

SqdnGuns 04-26-2012 11:33 PM

-current changing hostname
 
Did a fresh install of -current today and have a weird situation.

During install I set the hostname to "2540p" and when I rebooted I noted that my hostname was changed back to the default "darkstar".

I ran netconfig and changed it back to "2540p" and rebooted, no dice, it was back to "darkstar" again.

Code:

sqdnguns @ darkstar  ~ >> cat /etc/hosts
#
# hosts        This file describes a number of hostname-to-address
#              mappings for the TCP/IP subsystem.  It is mostly
#              used at boot time, when no name servers are running.
#              On small systems, this file can be used instead of a
#              "named" name server.  Just add the names, addresses
#              and any aliases to this file...
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine.  It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#

# For loopbacking.
127.0.0.1              localhost
127.0.0.1              2540p.sqdnguns.com 2540p

# End of hosts.

sqdnguns @ darkstar  ~ >> cat /etc/HOSTNAME
2540p.sqdnguns.com
sqdnguns @ darkstar  ~ >>

Any idea as to what I am doing wrong?

catkin 04-26-2012 11:58 PM

What is the output of the hostname command?

SqdnGuns 04-27-2012 12:00 AM

Quote:

Originally Posted by catkin (Post 4664137)
What is the output of the hostname command?

darkstar

catkin 04-27-2012 12:57 AM

What is the output of the hostname command after you have run netconfig?

Maybe -current is different but 13.37 sets the hostname in /etc/rc.d/rc.S from the contents of /etc/HOSTNAME. Would you like to (make a backup of rc.S and) add some debugging to rc.S?
Code:

# Set the hostname.
if [ -r /etc/HOSTNAME ]; then
  echo "/etc/HOSTNAME is readable and contains '$(cat /etc/HOSTNAME)'" >> /tmp/rc.S.log
  echo "Input to hostname command: $(cat /etc/HOSTNAME | cut -f1 -d .)" >> /tmp/rc.S.log
  /bin/hostname $(cat /etc/HOSTNAME | cut -f1 -d .)
else
  # fall back on this old default:
  echo "/etc/HOSTNAME is not readable: '$(ls -l /etc/HOSTNAME)'" >> /tmp/rc.S.log
  echo "darkstar.example.net" > /etc/HOSTNAME
  /bin/hostname darkstar
fi


SqdnGuns 04-27-2012 11:57 AM

Found this:

Code:

# /etc/NetworkManager/NetworkManager.conf
#
# See NetworkManager.conf(5) for more information on this file

[main]
plugins=keyfile
dhcp=dhcpcd

[keyfile]
hostname=darkstar

I am not familiar with Network Manager so I need to read up on it.

Not related to original topic but I see that when I drop into Run Level 3, I lose my network connectivity.

SqdnGuns 04-27-2012 02:01 PM

It appears that it was NetworkManager.conf

I edited the hostname and it appears to have fixed it.

Is this a "bug" with Networkmanager?

I will not mark this as solved until it is determined to be end user error or an actual bug.

guanx 04-27-2012 03:57 PM

Quote:

Originally Posted by SqdnGuns (Post 4664747)
It appears that it was NetworkManager.conf

I edited the hostname and it appears to have fixed it.

Is this a "bug" with Networkmanager?

I will not mark this as solved until it is determined to be end user error or an actual bug.

Although developers may thing this is a feature, ...

SqdnGuns 05-05-2012 01:25 AM

Marked as solved. Pat fixed this in the -current updates released tonight!

Code:

n/network-scripts-13.42-noarch-1.txz:  Upgraded.
  Add a 'NetworkManager' option to netconfig.
  Copy the hostname into NetworkManager.conf.  Thanks to SqdnGuns.



All times are GMT -5. The time now is 01:25 AM.