How to add services to autoload on CentOS

Command chkconfig does allow this. If you type chkconfig –list you’ll see the list of currently known services.

gpm            	0:off	1:off	2:on	3:on	4:on	5:on	6:off
httpd          	0:off	1:off	2:off	3:off	4:off	5:off	6:off
lvm2-monitor   	0:off	1:on	2:on	3:on	4:on	5:on	6:off
mcstrans       	0:off	1:off	2:on	3:on	4:on	5:on	6:off
multipathd     	0:off	1:off	2:off	3:off	4:off	5:off	6:off
mysqld         	0:off	1:off	2:off	3:off	4:off	5:off	6:off
netconsole     	0:off	1:off	2:off	3:off	4:off	5:off	6:off
netfs          	0:off	1:off	2:off	3:off	4:off	5:off	6:off
netplugd       	0:off	1:off	2:off	3:off	4:off	5:off	6:off
network        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
rawdevices     	0:off	1:off	2:off	3:on	4:on	5:on	6:off
rdisc          	0:off	1:off	2:off	3:off	4:off	5:off	6:off
rsyslog        	0:off	1:off	2:off	3:off	4:off	5:off	6:off
sshd           	0:off	1:off	2:on	3:on	4:on	5:on	6:off
syslog         	0:off	1:off	2:on	3:on	4:on	5:on	6:off

Each column stands for so called runlevel. In order to start service you must enter

chkconfig --level 3 mysqld on


Level 3 stands for normal working mode, if you use console login only, for graphic mode command looks like

chkconfig --level 5 mysqld on

If you what to add custom service (for example, vsftpd) check if the path /etc/init.d/vsftpd exists and is executable. Then enter

chkconfig --add vsftpd

and set desirable runlevel.

Share
Posted By admin

Leave a Reply

You must be logged in to post a comment.