Chkconfig of Linux system start-up process

Source: Internet
Author: User

Depending on the user's requirements, some scripts need to be run automatically after the system starts normally.

chkconfig xxx on this command automatically creates a script in the corresponding RC2 RC3 RC4 directory

Take RC2.D to see it first.

This is the content of a file in the rc2.d directory, chkconfig 2345 57 43

2345 indicates the RunLevel, running the script when the system is running at 2 3 4 5, and 57 is the power-on priority 43 is the shutdown priority. The lower the priority number of the boot, the higher the priority, and the shutdown priority is the must not the higher the number.


This is a test script I wrote myself.

Note: This script must be in the/ETC/RC.D/INIT.D directory

Chkconfig--add chk.sh To enable the script to run automatically, but regardless of whether the script specifies a run level, rc2.d rc3.d rc4.d rc5.d will produce xxchk.sh script files

View existing Open Services

The result of this display matches the script I just wrote myself.

How do I delete an already configured startup item?

Chkconfig--del


Rc.local

This special file needs to be said separately, if the administrator has a command to run at boot time, but this command is not worth writing a script, then you can put the command into rc.local. This will be done every time the system is turned on, and this file default is not execute permissions, you need to manually add Execute permissions


There is also an easy way to set the open item

Specify the run level directly in the parameter

The effect of this command is that there are s50chk.sh script files in the RC3.D directory, but there are no script files about chk.sh in other rc2.d rc4.d directories, unlike chkconfig--add xxx.sh commands.




Chkconfig of Linux system start-up process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.