Thursday, December 28, 2006

RedHat: command of the day: chkconfig

I'm administering a few Red Hat ES 3 servers now, after a lapse of in the Windows system admin world, and I was delighted to find this command:

chkconfig

It's my hero. Whomever thought up this command is my hero. For those of us who got tired of having to add a new service to all of the rc directories, set up all the symbolic links back to init.d services, this is the command for you.

Take it out for a test drive with
chkconfig --list sshd
and it will tell you which run levels it's configured for. Is it on, is it off?

And if you want to add a new service, once it's in the init.d directory, run this:
chkconfig --add newservicename
and
chkconfig --level 2 httpd on
to add httpd to run level 3.

There. Consider that my contribution to sharing useful things that may be common knowledge to some, and not to others.

Reference: run levels, init scripts, rc, init.d, services

No comments: