Linking init script to specific rc0.d, rc1.d etc directories
Hi All,
I have written an init script which I have kept under /etc/init.d, I need to create links to the directories rc0.d, rc1.d, rc2.d, rc3.d etc.. So that I can use chkconfig command to control the starting and stopping of the script at specific runlevels. Any good tutorials for this ? Please advice. Thanks in advnace. |
Simply, all you need is ln -s:
Code:
ln -s /etc/init.d/<your_script> /etc/rc3.d/S64<service_name> On the other way, if you put the description about runlevel, processname, ... at the begin of init script, something like this: Code:
# chkconfig: - 64 36 Code:
chkconfig --add <service_name> |
Thanks a lot quanta.
I have a small doubt Code:
# chkconfig: - 64 36 In the above code, Are 64 and 36 arbitrary numbers. Is their any constraint to choose these numbers ? Thanks in advance. |
Looking at the line begining with # chkconfig: - means all runlevel, you can change to something like 35. 64 is priority to start your service, and 36 is priority to stop. There is no contraint to choose these numbers but I often choose around the priority of common services: sshd, mysqld, httpd, ntpd, ...
|
Quote:
|
All times are GMT -5. The time now is 02:56 AM. |