In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the example analysis of managing linux boot service. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Self-starting services are very important, such as
(1) you need to manually add the service you want to start automatically. If you do not add it automatically after installing svn, you need to add it manually.
(2) after installing some programs, it is automatically added to self-startup, but we do not need to remove it manually.
(3) many malicious programs will add themselves to self-startup, which need to be checked and deleted.
The principle of running level
When it comes to self-starting operations, you will be exposed to the seven directories of / etc/rc.d/rc [0-6] .d
These directories represent the seven runtime levels of linux
The / etc/inittab file specifies which level to enter by default when the system starts
After Linux enters the run level, it will enter the corresponding rcN.d directory and retrieve the files in the directory according to the order of file names.
The rcN.d directory is full of linked files that point to service script files in the / etc/init.d directory, such as
The naming rules are:
Kroomnn+ service name, or Signornn+ service name
The K-system will terminate the corresponding service.
S-the system will start the corresponding service
Nn-two digits, execution order
What are the 7 runlevels?
0. Stop
1. Single-user mode, root permission, for system maintenance, no remote login
2. Multi-user status, no NFS
3. Standard multi-user mode, enter command line mode after login
4. The system is not in use and is retained.
5. Multi-user graphics mode, enter graphics GUI mode after login
6. Restart
Servers are generally in command line mode, so the default run level is 3
How do I add a self-booting program?
(1) add to / etc/init.d directory
Take starting SVN as an example
1) create a script to start the service under the / etc/init.d directory
Vim / etc/init.d/svn
Content
#! / bin/bash
Svnserve-d-r / svn warehouse path
Set execution permissions
Chmod 755 / etc/init.d/svn
2) soft link this script to / etc/rc.d/rc3.d
Ln-s / etc/init.d/svn / etc/rc.d/rc3.d/S101svn
S stands for the script to be executed. 101 is the execution order, usually greater than 60, which ensures that the basic services have been started.
Restart the linux test
(2) add to / etc/rc.local file
Modify / etc/rc.local directly
The script is executed after the system initialization level script runs, so you can add scripts that you want to execute after the system starts
(3) add chkconfig command
How to disable self-starting programs?
(1) directly delete the target link file in the / etc/rc.d/rcN.d directory
(2) delete the startup script defined in / etc/rc.local file
(3) View the list of self-starting services and select the target service to perform the forbidden operation.
Chkconfig-list
Chkconfig-del service name
This is the end of the article on "sample Analysis of Managing linux Boot Service". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.