Wednesday 25 July 2012

Adding Service in Chkconfig List of Linux OS

Adding Service in Chkconfig List of Linux

1.       Please add the following lines at start of script.

vi  /etc/init.d/<Service Name>

Ex-     

vi  /etc/init.d/websphere-app01

                 #!/bin/bash
                 #
                 # chkconfig: 2345 20 80
                 # description:  Web sphere Application Service
     
           :wq!

 This  says  that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop  priority should be 80.  You should be able to figure out what the description says; the  causes the line to be continued.   The  extra  space in front of the line is ignored.
2.       Add the service in chkconfig

#chkconfig –add  <service name>

Ex-     # chkconfig –add  websphere-app01

3.       You can check the added service.

chkconfig –list | grep  <service name>

Ex-     # chkconfig –list | grep  websphere-app01

-------------------------------------------------END------------------------------------------------------------

No comments:

Post a Comment