problem encountered after changing hostname
My machine is on a private LAN connected to a router (with DHCP enabled) and Fedora Core 4 assigned it the uninformative default name locaIhost.localdomain. I wanted to change the default name of my machine to something more informative.
First I tried using the command hostname. The command executed successfully but when I did "hostname -f" I got the error "hostname: unknown host" So I edited /etc/hosts which now contains a single line "127.0.0.1 newhostname newhostname". I rebooted, but the machine name did not change, as evidenced by the login screen, the output of the command "hostname", and the prompt. Then I edited /etc/sysconfig/network to set "NETWORK=newhostname". During reboot, "Starting sendmail" took an unreasonable long time (which was never this long before) such that I thought the machine has hang. After I finally logged in, I saw that the machine name has changed, as evidenced by the login screen, the output of the command "hostname", and the prompt. I was able to ping my machine's IP address, 127.0.0.1, newhostname, and localhost. Does anyone know how to fix the problem of sendmail taking a freakishly long time to start? Thanks for any help. |
thanhvn
This is totally from memory because I'm currently in Gentoo which uses a different format /etc/hosts 127.0.0.1 hostname.domainname hostname localhost.localdomain As an example 127.0.0.1 server.linuxquestions.org server localhost.localdomain /etc/sysconfig/network NETWORKING=yes HOSTNAME=server Obviously "server" comes from the example above Pete |
Pete, I don't have a problem changing the hostname (read my post carefully). The problem I have is that after successfully changing the hostname, the sendmail service takes an unreasonably long time to start. What I want to know is how to fix that.
|
This startup delay is most likey caused by sendmail not being able to resolve the host name, the host name is usually defined in the file /etc/mail/local-host-names . Change the entry in that file to match your new host name and the delays should be gone.
HTH Mad. |
thanhvn
Sorry I did'nt understand your exact problem but as madluther stated if sendmail can't determine it's host name then this will cause a delay As it checks /etc/hosts for this the format of the file must be correct Pete |
After several trials and errors, I finally figured out the solution to the problem. The value of the parameter inet_interfaces in /etc/postfix/main.cf must match one of the values in /etc/hosts. By default inet_interfaces is set to localhost. And since I've changed /etc/hosts to no longer contain localhost, this caused the problem. So I changed /etc/hosts to "127.0.0.1 localhost.localdomain localhost newhostname" and the problem is solved (and my machine name is still changed to newhostname as I originally set out to do). Thanks for all the help.
|
thanhvn
Glad you got the problem fixed, but the correct information in the first place may have speeded up the process Original post Quote:
Quote:
Have fun Pete |
All times are GMT -5. The time now is 03:00 AM. |