CentOS was stuck in sendmail when it started.

Source: Internet
Author: User
Today when you are in a fully distributed cluster of Hadoop, when you start CentOS, you always stop at starting sendmail for a long time, and the next starting sm-client is unusually slow. Later, we found that the original is related to the change of hostname. Recall that I had indeed changed the hostname. However, only the configuration file (/etc/sysconfig/network) was modified. "This is because SendMail's server name (preset is hostname) cannot be resolved by gethostbyaddr, and when it is not resolved, it waits for timeout, so it has been waiting for so long," said the Internet. So, in the/etc/hosts there is no response or DNS there is no record.

So, the solution to this problem is to add the hostname to the/etc/hosts file (after adding the hostname to the 127.0.0.1) by modifying the configuration file to change the hostname. Of course, can also directly stop SendMail service.

In fact, to change the host name to do three things:

1, modify the/etc/sysconfig/network configuration file, hostname= "host name";

2, add the host name to the/etc/hosts file. Enables the host name to be parsed.

/etc/hosts:

192.168.1.119 Server.localdomain Server

/etc/sysconfig/netwrok:

Hostname=server.localdomain

The first column of the P.S./etc/hosts file is the network address, the second column is the host name, and the third column is the host alias

3, the host name has been modified successfully, but the shell prompt displays the original hostname and needs to be restarted before it can be changed.

Use the command; hostname host name this way, the hostname is completely modified.


Prohibit SendMail service:

1. End SendMail Service: # killall SendMail

2. Delete SendMail in automatic startup: #chkconfig--del SendMail

3. Disable SendMail: #chkconfig sendmail off

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.