LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-06-2005, 12:26 AM   #1
thanhvn
Member
 
Registered: Mar 2005
Location: CA
Distribution: RHEL3, FC4
Posts: 46

Rep: Reputation: 15
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.
 
Old 07-06-2005, 05:05 PM   #2
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 31
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
 
Old 07-07-2005, 02:01 PM   #3
thanhvn
Member
 
Registered: Mar 2005
Location: CA
Distribution: RHEL3, FC4
Posts: 46

Original Poster
Rep: Reputation: 15
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.
 
Old 07-07-2005, 02:15 PM   #4
madluther
Member
 
Registered: Aug 2004
Distribution: LFS
Posts: 350

Rep: Reputation: 30
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.
 
Old 07-07-2005, 03:25 PM   #5
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 31
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
 
Old 07-08-2005, 12:16 AM   #6
thanhvn
Member
 
Registered: Mar 2005
Location: CA
Distribution: RHEL3, FC4
Posts: 46

Original Poster
Rep: Reputation: 15
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.
 
Old 07-08-2005, 01:36 AM   #7
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 31
thanhvn

Glad you got the problem fixed, but the correct information in the first place may have speeded up the process

Original post
Quote:
During reboot, "Starting sendmail" took an unreasonable long time
Last post
Quote:
The value of the parameter inet_interfaces in /etc/postfix/main.cf must match one of the values in /etc/hosts
Sendmail or Postfix ?

Have fun

Pete
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem encountered during dovecot installation. vivaspeed Linux - Networking 1 07-12-2005 01:38 AM
Encountered the problem as compiling the glibc-2.3.5 amaolei Linux - Laptop and Netbook 1 05-02-2005 08:12 AM
problem encountered on installing qpopper robrey13 Linux - Newbie 3 12-03-2004 04:34 AM
First problem encountered... minotaur_6 Linux - Newbie 2 02-01-2004 05:48 AM
Weird problem encountered while trying to install GCC sykopath Linux - Software 3 08-08-2003 03:08 AM


All times are GMT -5. The time now is 02:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration