Page 1 of 1

Solved: How do I let a service start at boot on CentOS

Posted: Tue Mar 20, 2012 6:39 pm
by mister_v
Hello,

how wow do I let a service start at boot on CentOS.

some start automatically, but some not.

thanks

Re: How do I let a service start at boot on CentOS

Posted: Tue Mar 20, 2012 7:29 pm
by chris
You can do this with the builtin chkconfig utility:

Code: Select all

sudo /sbin/chkconfig --list
This command show you all the services and their status on each runlevel.

If you don't see your service in it (mysqld for example?), you can add it.

Code: Select all

sudo /sbin/chkconfig --add mysqld
You also need to set it to ON, in the desired runlevel.
For servers this is mostly runlevel 3.

Code: Select all

sudo /sbin/chkconfig --level 3 mysqld on
Now it should start when the system is rebooted.

For the record the runlevels:
0 - Halt
1 - Single-user text mode
2 - Not used (user-definable)
3 - Full multi-user text mode
4 - Not used (user-definable)
5 - Full multi-user graphical mode (with an X-based login screen)
6 - Reboot

Re: How do I let a service start at boot on CentOS

Posted: Wed Mar 21, 2012 11:31 am
by mister_v
Thanks, just what I needed.