In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to add a boot script to the Linux system, which is very detailed and has a certain reference value. Interested friends must read it!
1. Write a script autostart.sh (here, take starting the redis service as an example). The script content is as follows:
#! / bin/sh # chkconfig: 2345 8090 # description: boot the script program automatically # Open the redis service port to 6379 / usr/local/service/redis-2.8.3/src/redis-server-- port 6379 & the first line of the script "#! / bin/sh" tells the system which shell to use The second line of the script "# chkconfig: 2345 8090" indicates that the runlevel start, startup number (S80), and shutdown number (K90) are started at run level 2max / 3max / 4max / 5; the third line of the script represents the description of the service.
Note: the second and third lines must be written, and errors such as "Service autostart.sh does not support chkconfig" will occur.
two。 Move the written autostart.sh script to the / etc/rc.d/init.d/ directory
3. Assign executable permissions to the script
Cd / etc/rc.d/init.d/ chmod + x autostart.sh4. Add a script to the boot auto startup project
Chkconfig-add autostart.sh chkconfig autostart.sh on above is all the content of this article "how to add boot script to Linux system". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.