[LINUX] -- service management, linux -- service
I. Service Classification
1. Binary Package
(1) Quickly install, uninstall, upgrade, and manage software
(2) simple installation and Fast Installation
(3) The Source Code cannot be directly obtained after encapsulation.
(4) Poor feature selection and inflexible Customization
2. source code package
(1) obtain the latest software version and fix bugs in time
(2) flexibly customize software functions based on user needs
2. RPM package Service Management
The software installed in the RPM package has specific management commands. There are two management methods:
1. independent services:
The so-called independent startup means that you can manage the startup independently. It has nothing to do with the startup of other software and does not depend on the startup of other software. Such software will respond directly when called, fast request processing. Currently, most services in Linux are independent services.
Manual start:
(1) Start the script,/etc/init. d/A service script file
/Etc/init. d/httpd start
(2) service Management Tools
Service httpd start | stop | restart
Self-starting:
(1) Use the chkconfig Service self-start tool for management
View the auto-start of the software:
Chkconfig-list | grep service name
Set the auto-start of a service:
Chkconfig [-- level] [independent service name] [on | off]
(2) Use ntsysv to set the auto-Start Software
Netsysv -- level # Sets whether the software is started at a certain level.
F1: displays service description
Xinetd-based services:
This kind of service cannot be started independently. It must be started or closed by a certain management service. This management service is our xinetd service, which is a super daemon process of Linux, it is used to manage services that cannot be started by itself. When the client requests the service to start, the request will be accepted by the xinetd service first, and then the xinetd will wake up the corresponding service to start a service. This type of service will not always be enabled. The corresponding service will be awakened only when the xinetd service receives the request. After processing, the service will be closed, which greatly saves the server resources, however, the response speed of the corresponding software is not as fast as that of independent services.
Xinetd-based-telnet
Here, we use the telnet service to illustrate the problem! Telnet is a remote management command, but because the transmission process is plain text, so... We do not use it. We use a safer ssh, And the telnet port is 23. We use xinetd to start our telnet.
(1) manually start a service in xinetd
Vim/etc/xinetd. d/telnet
Here we only need to change disable = yes to no!
Then restart the xinetd service (note that we are now using xinetd to manage telnet)
(2) set service self-starting in xinetd
Chkconfig and ntsysv are also used for self-starting. However, we need to note that we do not set the auto-starting of a specific service, but set the auto-starting of xinetd.