Hello,
how wow do I let a service start at boot on CentOS.
some start automatically, but some not.
thanks
Solved: How do I let a service start at boot on CentOS
-
mister_v
- Posts: 203
- Joined: Thu Mar 04, 2010 9:19 pm
Solved: How do I let a service start at boot on CentOS
Last edited by mister_v on Wed Mar 21, 2012 11:31 am, edited 1 time in total.
-
chris
- Site Admin
- Posts: 216
- Joined: Mon Jul 21, 2008 9:52 am
Re: How do I let a service start at boot on CentOS
You can do this with the builtin chkconfig utility:
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.
You also need to set it to ON, in the desired runlevel.
For servers this is mostly runlevel 3.
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
Code: Select all
sudo /sbin/chkconfig --listIf you don't see your service in it (mysqld for example?), you can add it.
Code: Select all
sudo /sbin/chkconfig --add mysqldFor servers this is mostly runlevel 3.
Code: Select all
sudo /sbin/chkconfig --level 3 mysqld onFor 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
-
mister_v
- Posts: 203
- Joined: Thu Mar 04, 2010 9:19 pm
Re: How do I let a service start at boot on CentOS
Thanks, just what I needed.