Home > Tweet > How to auto start services on boot in Centos / Redhat?

How to auto start services on boot in Centos / Redhat?

To auto start services in Centos or Redhat OS, you can use builtin chkconfig utility. It is located in /sbin directory. If you are a regular user (non-root), then /sbin may not be in your path. Therefore, you may have to use the full path to access the chkconfig utility.

To auto start a new service:

  • Find out the name of service’s script from /etc/init.d/ directory e.g. mysqld or httpd
  • Add it to chkconfig
    sudo /sbin/chkconfig --add mysqld
  • Make sure it is in the chkconfig.
    sudo /sbin/chkconfig --list mysqld
  • Set it to autostart
    sudo /sbin/chkconfig mysqld on

To stop a service from auto starting on boot

  • sudo /sbin/chkconfig mysqld off
  1. Alijanich Feb 4th, 2012 @ 12:37 | #1

    thanks, very helpful

  2. Asd Dec 15th, 2012 @ 07:56 | #2

    chkconfig –add
    chkconfig –list

  3. Boyko Feb 27th, 2013 @ 23:52 | #3

    Excellent! This helped! Thanks! I also had to use double dash (–add –list) as the previous poster. I'm running CentOS 5.5. 

  4. 490a Jan 3rd, 2014 @ 11:16 | #4

    thanks, this was quite useful

Submitting Comment, Give me a second...

Leave a comment

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackbacks & Pingbacks ( 1 )
  1. Dec 2nd, 2013 @ 11:43 | #1
    Pingback: Centos :: Set a service as Start Up service | www.untacomei.com