In this article we will discuss a very handy tool named chkconfig. this utility allows you to handle services in different LINUX Run Level Modes.
LINUX / UNIX / UBUNTU has 6 run level types which almost available in all distro.
0 – halt (Do NOT set initdefault to this)
1 – Single user mode
2 – Multiuser, without NFS (The same as 3, if you do not have networking)
3 – Full multiuser mode
4 – unused
5 – X11
6 – reboot (Do NOT set init default to this)
This utils allow you to run your LINUX box with different modes you can set this values in /etc/inittab and when you select default values from above mentioned values you just need change
id:3:initdefault:
if this value is set this mean Box will boot with Full Multi User mode.
Ok! lets talk about Chkconfig. this utility allows you to run services in different modes lets take it like that you have a linux running with init 2 run level and you have application that needs NFS so what you nees is just to turned off services for this particular run level.
Example : You have a tool installed “Apache” and you want if i run my Box in single user mode so my Apache should not work my Apache should only work when BOX is running Multi User wihout NFS, Full User Mode, X11 mode so what you need to set.
chkconfig –level 235 /etc/init.d/apache
when you run this command into your LINUX box so your APACHE services only starts when Box is running with one of mentioned run level. you can defined your values as per your requirement.
chkconfig –list = list all the services with their run levels
chkconfig service-name on/off = This will use to enable or disable services in current run level.
I hope this article will help people alot.
Regards,
ITMarkaz Technologies.
“Now Solutions is in your hands”