Ubuntu uses 2, while former distribution I used always used Often this is 5 or 2 - there are various conventions, but nothing really established, afaik. You test, what runlevel your machine normally starts into. ![]() The example start, stop and status code uses helper functions defined in /etc/init.d/functionsĮnable the script $ chkconfig -add myscriptĬheck the script is indeed enabled - you should see "on" for the levels you selected. > 5, that its start priority should be 20, and that its stop priority The ckconfig man page explains the header of the script: > This says that the script should be started in levels 2, 3, 4, and You can then use the script like so /etc/init.d/myscript start or chkconfig myscript start. The format is pretty standard and you can view existing scripts in /etc/init.d. # description: Description comes here.Įcho "Usage: $0 " ![]() The script should have the following format: ![]() Create a script and place in /etc/init.d (e.g /etc/init.d/myscript).If you are on a Red Hat based system, as you mentioned, you can do the following:
0 Comments
Leave a Reply. |