In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "what are the service types of linux". In the daily operation, I believe many people have doubts about the service types of linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what are the service types of linux?" Next, please follow the editor to study!
According to the management mode, linux services can be divided into two categories: "stand-alone" and "super-daemon", that is, independent management services and unified management services. The independent management service can be started independently without the management of other mechanisms, while the unified management service is responsible for starting and managing through a unified daemon.
The operating environment of this tutorial: CentOS6 system, Dell G3 computer.
The service of a Linux system, also known as daemon, refers to a process that runs continuously in memory to provide the required services (system or network services).
classification
According to the management mode, the services of Linux system can be divided into two categories: stand-alone and super-daemon, that is, independent management service and unified management service.
Stand-alone: this type of service mechanism is relatively simple and can be started independently. Its characteristics are as follows:
1. It can be started independently without the management of other mechanisms.
2. Once the stand-alone service is started and loaded into memory, it will always take up memory space and system resources until the service is stopped.
3. Because the service is running all the time, it is faster to respond to client requests.
Typical stand-alone services are: httpd, and ftp
Super-daemon: this management mechanism is responsible for starting and managing other services through a unified daemon. In CentOS6.X, this super-daemon is the xinetd program. The characteristics are:
1. All services are controlled by xinetd, so there can be a security control mechanism for xinetd, such as network firewall
2. Before the clinet request, the required service is not started; the xinetd will not wake up the corresponding service until the client requests the service; once the connection ends, the corresponding service will be shut down. So super-daemon will not occupy system resources all the time.
3. Since the service is started only when there is a request, the response speed of the server is naturally not as fast as that of stand-alone.
Typical super-daemon services are: telnet, etc.
Different startup modes
Different services in Linux have different startup scripts for environment detection, configuration file analysis, PID file planning and other related operations before service startup. The location of startup scripts in stand-alone mode and super-daemon mode is different, and the startup mode is naturally different.
Stand-alone
Startup script
The stand-alone startup scripts are located in the / etc/init.d/ directory, where virtually all service startup scripts are located.
[root@localhost init.d] # ls / etc/init.d/abrt-ccpp htcacheclean ntpd smartdabrtd httpd ntpdate snmpdxinetd. (omitted)
Have you found that this directory contains not only httpd, which we know about stand-alone service startup scripts, but also xinetd! What does that mean?
This shows that the xinetd service is actually managed using stand-alone. Do you think, because xinetd is responsible for enabling services that stop many super-daemon, does it have to be resident in memory?
Startup method
Method 1: since all the startup scripts are in / etc/init.d/, just call them directly!
[root@localhost init.d] # / etc/init.d/crond Usage: / etc/init.d/crond {start | stop | status | restart | condrestart | try-restart | reload | force-reload}
Calling it directly will tell you Usage, so
[root@localhost init.d] # / etc/init.d/crond restartStopping crond: [OK] Starting crond: [OK]
It's that simple!
Method 2: you can also use the script service:
[root@localhost init.d] # service crond statuscrond (pid 3278) is running...
This is easier, but service can only be used to manage stand-alone services.
Also, this usage can view the status of all stand-alone services in the system [root@localhost init.d] # service-- status-allabrt-ccpp hook is installedabrtd (pid 2331) is running...abrt-dump-oops is stoppedacpid (pid 1807) is running. (omitted)
NOTE: since the service script is not available in all Linux distributions, the / etc/init.d/* [action] approach is recommended. It also helps to understand the principle.
Super-daemon
Startup script
The super-daemon startup script is placed in / etc/xinetd.d/.
[root@localhost xinetd.d] # ls / etc/xinetd.d/chargen-dgram daytime-stream echo-dgram tcpmux-server time-stream. (omitted)
Check out the services started by super-daemon:
Method 1: using chkconfig, you can see the startup of a service in xinetd based services:
[root@localhost xinetd.d] # chkconfig .xinetd based services: echo-dgram: off echo-stream: off rsync: off tcpmux-server: off telnet: on.
Method 2: view the startup script of the service directly
[root@localhost xinetd.d] # grep-I 'disable' / etc/xinetd.d/*./etc/xinetd.d/daytime-dgram: disable = yes/etc/xinetd.d/daytime-stream: disable = yes/etc/xinetd.d/discard-dgram: disable = yes/etc/xinetd.d/discard-stream: disable = yes/etc/xinetd.d/echo-dgram: disable = yes/etc/ Xinetd.d/telnet: disable = no.
The disable= no above indicates that the service has been enabled.
Startup method
We already know that a disable= no item in the startup script indicates that the service is enabled, so our startup method is as follows:
1. Edit the startup script first and change the service disable that needs to be enabled to no.
2. Then restart xinetd:/etc/init.d/xintd restart [because xinetd itself is a service of stand-alone]
At this point, the study on "what are the service types of linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.