Create a startup service in CentOS

Here is a sample on running a service to startup in centos:

1) Create a new script under /etc/init.d/asternicd

#!/bin/sh
# chkconfig: 2345 90 10
# description: This script is myscript
 

Step2) make the script executable:

chmod +x /etc/init.d/asternicd

Step3) add the service to chkconfig

chkconfig --add asternicd

Step4) check whether the service is added as startup:

chkcknofig --list asternicd

Check this link for Debian: http://www.debian-administration.org/articles/28

You may also like