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