Turn http://www.cnblogs.com/jimeper/archive/2013/03/12/2955687.html
Create a service manually
1. Create a shell script in the/ETC/RC.D/INIT.D directory, file name Auto_run
2.chkconfig--add Auto_run
Self-starting Shell format and attention points
Example, the first three lines of Auto_run are as follows:
#!/bin/sh
#chkconfig: 2345 80 90
#description: Auto_run
The first line tells the system to use the shell, so the shell script is like this.
The second line, chkconfig after the three parameters 2345,80 and 90 tells the Chkconfig program, need to RC2.D~RC5.D directory, create a file name S80auto_run, connect to/etc/rc.d/ The Auto_run script under the INIT.D directory. The first character is S, when the system starts, run the script auto_run, it will add a start parameter, tell the script, is now the startup mode. At the same time in the RC0.D and RC6.D directory, create a file connection named K90auto_run, the first character is K, when the system shuts down the system, it will run Auto_run, add a stop, tell the script, is now off mode.
Note that in the above three rows, the second, the third line is required, otherwise, when running Chkconfig--add Auto_run, an error will be shown.
4. Common Mistakes
"Service does not support Chkconfig":
Please note that there are two full lines in front of the check script:
#chkconfig: 2345 80 90
#description: Auto_run
In front of the script these two lines are not few, otherwise cannot chkconfig the command will report the error.
If the running Chkconfig always error, if the script is not a problem, I suggest, directly under RC0.D~RC6.D to create a file connection to the script to resolve, the principle is the same.
Linux Custom Boot Service