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

# 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:

You may also like