Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the methods of booting Linux self-starting service?

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the methods of Linux boot self-startup service, the article is very detailed, has a certain reference value, interested friends must read it!

Rc.local mode

1 first create a script to be self-started

Vi / EtcUniversScriptsUniverse createFile.sheduleBingray Bash # start up to create a folder mkdir / opt/ccc

two。 Give executive authority

Chmod 777 createFile.sh

3. Add the absolute path to the script in the / etc/rc.d/rc.local file

4. Give rc.local execution permission

Chmod 777 rc.local

Restart the service and find that a ccc folder has been created under the opt path

View script process process

Ps-ef | grep createFile

Chkconfig mode

1. Create a boot startup script

Vi createjava.shresume binbinbinbinbinbinbinbinbinbinbinpxpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (vi createjava.sh It is possible that the startup is not successful because the network service it depends on has not yet been started, resulting in a failure of self-startup. # description:createjava.sh is the description information

two。 Give executable authority

Chmod upright x createjava.sh

3. Copy the script to the / etc/init.d directory

Cp createjava.sh / etc/init.d/

4. Add to service

Chkconfig-add / etc/init.d/createjava.sh

5. Restart the server

Init 6

The nihao.java file has been created

These are all the contents of this article entitled "what are the methods of booting the Linux self-boot service?" 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report