In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how to set up Linux to boot. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Method 1: edit the rc.loacl script
Add the startup script directly to / etc/rc.local.
$vim / etc/rc.local method 2: Linux starts the service by setting chkconfig to boot
Create script
Vim / etc/init.d/bootshell
Edit the script as follows (the format of the first three lines of the script is fixed)
#! / bin/sh#chkconfig: 2345 100 101#description:bootshellcase "$1" instart) echo "start service";; stop) echo "stop service";; esac
Description:
The first line tells the shell used by the system that all shell scripts are like this.
On the second line, chkconfig is followed by three parameters 2345100 and 101 that tell the chkconfig program that you need to create a file connection named S100bootshell in the rc2.d~rc5.d directory to the test2 script in the / etc/rc.d/init.d directory. The first character is S, and when the system starts, running the script bootshell, it adds a start parameter, telling the script that it is in startup mode. At the same time in the rc0.d and rc6.d directories, create a file connection named K90bootshell, the first character is K, when the system shuts down the system, it will run bootshell, add a stop, and tell the script that it is in closed mode. Note that of the three lines above, the second and third lines are required, otherwise an error will be reported when running chkconfig-add bootshell.
The smaller the running level, the more priority it is to run. When the priority is the same, it starts at the creation time.
Set execution permissions to the file
Chmod + x / etc/init.d/bootshell
Test script
/ etc/init.d/bootshell start
Chkconfig create service
Chkconfig-add bootshell
At this point, there are created files under the rc2.d-rc5.d folder.
Verify the configuration chkconfig-- list delete service chkconfig-- del bootshell closes one of Linux's boot self-startup service chkconfig-- level 2345 bootshell off
In CentOS, the service startup script is placed in: / etc/rc.d/init.d and / etc/init.d is the recognized directory, and in centos / etc/init.d is a linked archive / etc/sysconfig service initialization environment variables are configured in this file.
Thank you for reading! This is the end of this article on "how to set Linux to boot". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can 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: 223
*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.