Solve the slow startup failure (switch) of Sendmail and Sm-client in centos (RedHat)

Source: Internet
Author: User

 

Starting Sendmail:

Starting Sm-client:

After I posted an article about modifying the host name, I accidentally found that when centos was restarted, the system would be stuck in Sendmail and Sm-client for nearly three minutes, I found the Sendmail and Sm-client documents and found that I had made an error.

The reason is that Sendmail and Sm-client are both MTA and only the network host name, such as admin.slyar.com. localdomain is changed to slyar, which does not comply with the network host name specification, so the startup speed is slow. The solution is as follows:

1. Change the host name under/etc/sysconfig/network to the network host name.Slyar. localdomain

# Vim/etc/sysconfig/Network

 

2. Change the host name under/etc/hosts to the network host nameSlyar. localdomain

# Vim/etc/hosts

3. restart the system so that the system will not be slow in the future.

# Reboot

Disable starting Sendmail:, use chkconfig Sendmail off to disable it.

Http://blog.sina.com.cn/s/blog_6631bc8d01014pi2.html

I. Prerequisites
First, you need to install sendmail. If you choose to install it all during Linux installation, Sendmail is already in your system. If not, install it.
Second, your DNS must be correctly configured and complete; otherwise, the sendmail service may not run properly.
If your system is installed as described above, the configuration of the sendmail service can be said to be very simple. For details about DNS configuration, please refer to the article on this site.
Ii. configuration process
1. Modify the/etc/mail/Access File
As shown below: domain.com relay // "domain.com" is the name of your domain
192.168.0 relay // allow machines with 192.168.0. * to send emails through your machine
Then enter the following command to convert:
Makemap hash access. DB <access
2. Modify or create a file:/etc/mail/relay-domains:
192.168.0
In this way, you can. This configuration may cause many problems. The above is the simplest method I have summarized after more than a dozen installation and configuration of Linux. I hope it will help you. Note that your DNS must be correct, otherwise Sendmail will not work well.
3. Common Sendmail commands and test and Related Files
A. Related Documents
/Etc/sendmail. cf
/Etc/sendmil. CW
/Etc/inetd. conf
The following files are available in the/etc/mail directory:
Access. DB access
Mailertable. DB mailertable
Aliases. DB aliases
B. Commands
1. Restart the sendmail service.
The/etc/rc. d/init. d directory contains the sendmail File. Run the following command:
./Sendmail restart
2. Check whether POP3 port is enabled
Command: netstat-A | grep pop
If the following information is displayed, the POP3 port is Enabled:
TCP 0 0 *: POP3 *. * listen
3. Check whether the sendmail service is enabled.
PS-axuw | grep sendmail
If it is started, there will be some prompts.

Http://www.linuxidc.com/Linux/2006-12/1333.htm

When the system starts, it finds that the progress bar is stuck in Sendmail and finds a way to stop the service. Directly stop the service. You can enter service Sendmail stop on the terminal.

How to cancel startup:

1. Enter ntsysv on the terminal to cancel the sendmail service.

2. The chkconfig command can also be used to activate and stop services.
Run the command: chkconfig -- list Sendmail.
Sendmail 0: off 1: off 2: On 3: On 4: On 5: on 6: Off
It indicates that Sendmail is automatically enabled at level 2.3.4.5. Generally, the system is set to intermediate level (3). Therefore, Sendmail automatically restarts every time the machine is restarted.
Chkconfig -- level 2345 Sendmail off
In this way, Sendmail has been disabled at levels 2, 3, 4, and 5. In this way, Sendmail will not restart after the machine is restarted.

Http://blog.csdn.net/fedorayang/article/details/7633074

The ntsysv tool provides a simple interface for starting or stopping services. You can use ntsysv to start or close services managed by xinetd. You can also use ntsysv to configure the running level. By default, only the current running level is configured. To configure different running levels, use the "-- level" option to specify one or more running levels. For example, run the "ntsysv -- level 345" command to configure the runtime levels 3, 4, and 5. The ntsysv work interface is 4-7.

Use the up and down arrows to view the list.Use the Space key to select or cancel a Service Selection, Or use the "OK" and "cancel" buttons. To switch between the service list and the "OK" and "cancel" buttons, you can use the "tab" key. "*" Indicates that a service is set to start.

Http://www.linuxso.com/command/ntsysv.html

Netstat allows you to view the services that have been started,
Service can be used to start a service immediately.
Chkconfig is used to set the service to automatically start at startup..

-- Check whether the NFS service is automatically started upon startup. We can see that the NFS service is not started at six boot levels.
[[Email protected] ~] # Chkconfig -- list NFS
NFS 0: off 1: off 2: off 3: off 4: off 5: off 6: Off

-- Set to automatically start the NFS service at startup.
[[Email protected] ~] # Chkconfig NFS on

-- Check again. We can see that the NFS service is automatically started at levels 2, 3, 4, and 5.
[[Email protected] ~] # Chkconfig -- list NFS
NFS 0: off 1: off 2: On 3: On 4: On 5: on 6: Off

-- Disable automatic start of NFS at startup.
[[Email protected] ~] # Chkconfig NFS off

-- Check again. The NFS service will not be started after six levels are started.
[[Email protected] ~] # Chkconfig -- list NFS
NFS 0: off 1: off 2: off 3: off 4: off 5: off 6: Off

-- Set three levels to automatically start the NFS service at startup.
[[Email protected] ~] # Chkconfig -- level 3 NFS on

-- Check again. You can see that the NFS service is automatically started at the level.
[[Email protected] ~] # Chkconfig -- list NFS
NFS 0: off 1: off 2: off 3: On 4: off 5: off 6: Off

Bytes -------------------------------------------------------------------------------------------------------------------------

Ntsysv: Specifies the Startup Mode in Gui-like management mode. (RedHat is unique. Basically, chkconfig is easy to use .)

To sum up the functions, click:
Up and down keys: You can move between services in the middle box;
Space key: it can be used to select the service you need. [*] indicates that start is enabled;
Tab key: it can be moved between boxes, OK, and cancel;
[F1] key: displays the description of the service.
For example:

[[Email protected] ~] # Ntsysv
Ntsysv 1.3.30.1-(c) 2000-2001 Red Hat, Inc.

Http://www.linuxidc.com/Linux/2011-12/48396.htm

 

Solve the slow startup failure (switch) of Sendmail and Sm-client in centos (RedHat)

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.