First, the system script location and meaning
- /etc/inittab,/etc/init/* storage switch machine configuration file
- /etc/init.d/* service script, is a soft link to/etc/rc.d/init.d/
- /ETC/RC.D The switch scripts that store each operating level, are soft links to the/ETC/INIT.D directory
- The/ETC/RC.LOACL system starts the last stage of execution of the script, you can write commands that need to run directly in this file
II. basic syntax for startup scripts
As shown below, the Chkconfig line "2345" refers to the default at 2, 3, 4, 54 level boot Run, "12", "88" respectively refers to the script in the open, shutdown phase of the execution sequence (/etc/rc.d/rcx.d/directory, the start of the script starts with s), K does not start, and script names are sorted in the same order as the boot sequence! )
#!/bin/2345# description:xxxx
Third, the use of chkconfig
After the previous section, the script is ready to be added or removed with the following command to boot
Chkconfig---del NAME Note: A Soft link to add or remove scripts in/etc/rc.d/rcx.d/chkconfig [ --level NUM] NAME on|off| Reset Note: Set the startup status of the script or reset it to the default state in the script, which can be The--level option indicates the specific runlevel to start randomly
Chkconfig--list
Note: Displays the boot-up script information in each runlevel
Linux Basic notes--[021]--"RHEL6 series of Open, shutdown scripts"