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

How to add a custom script to boot self-startup under linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "how to add a custom script to boot under linux". The explanation in this article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how to add custom scripts to boot self-startup under linux".

Write a script auto_coreseek.sh:

The code is as follows:

#! / bin/sh

# chkconfig:2345 80 90

# description:auto_coreseek

/ usr/local/coreseek/bin/searchd

Put on / etc/init.d/auto_coreseek.sh

Then chmod + x / etc/init.d/auto_coreseek.sh

Then add it to boot:

Chkconfig-add auto_coreseek.sh

We're done.

And then study it. It's all gross.

There are several levels of chkconfig:

0: indicates shutdown

1: indicates single user mode

2: indicates no web link multi-user command line mode

3: indicates a multi-user command line mode with a network link

4: indicates unavailability

5: represents a multi-user mode with a graphical interface

6: indicates restart

So chkconfig:2345 means to start the service at a level of 2345.

The next 8090 are startup priority and shutdown priority, respectively.

When it comes to the priority of the program, the priority is also easy to understand, that is, the sequence in which the program is executed by CPU. The smaller the value, the higher the level. So the startup priority and shutdown priority here mean the priority of the startup script process and the priority of the shutdown script process.

Thank you for your reading, the above is the content of "how to add custom scripts to boot self-startup under linux". After the study of this article, I believe you have a deeper understanding of how to add custom scripts to boot self-startup under linux. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Servers

Wechat

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

12
Report