How to add a service on Linux using chkconfig

Add a service to  auto start in linux

  1. Add the below #comment lines on top of the script which always located /etc/init.d/
  2. #chkconfig: 2345 20 80
  3. #description: Saves and restores system

2,3,4,5 are starting levels
20 startup priority
80 stop priority
causes the line to be continued

Finally add services to  “autostart”

  1. chkconfig –add service1
  2. chkconfig –add service2