When centos is started, it is stuck in Sendmail

Source: Internet
Author: User

When we build a hadoop fully distributed cluster today,When centos is started, it always stops at starting Sendmail for a long time. The next starting Sm-client is also abnormal and slow.Later, I found out that it was related to the change of hostname. In retrospect, I actually changed the hostname. However, the configuration file (/etc/sysconfig/Network) is modified ).The Internet says, "This is because
The server name of Sendmail (default: Hostname) cannot be parsed by gethostbyaddr. It will wait for timeout when it cannot be parsed, so it has been so long. So, there is no response in/etc/hosts or there is no record in DNS ".

To solve this problem, you need to add the host name to the/etc/hosts file (after 127.0.0.1) after modifying the configuration file ). Of course, you can also directly stop the sendmail service.

In fact, there are three things to do to change the Host Name:

1. Modify the/etc/sysconfig/network configuration file, hostname = "Host Name ";

2. Add the host name to the/etc/hosts file. Resolve the host name.

/Etc/hosts:

192.168.1.119Server. 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 is successfully modified, but the original host name is displayed at the shell prompt. You need to restart the host to change the host name.

The host name is completely modified by using the command; hostname host name.


Disable sendmail:

1. End the sendmail service: # killall sendmail

2. Delete Sendmail: # chkconfig -- del Sendmail in auto start.

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.