Monday, August 25, 2008

Ubuntu's chkconfig: sysv-rc-conf and rcconf

Ubuntu's chkconfig

Hi, when I'm working in Ubuntu, and happen to install some daemons, make scripts to manage them, you know you always end up needing to manage the SysV init scripts links, to automatically start and stop the daemons.

Being as procrastinative (is that a word?) as I am, I always end up searching again and again on Google, "sysv init bash command" or "chkconfig alternatives for ubuntu" and search and search until I find for the Nth time the same results.

That's the reason for this post. There are two alternatives, native to Ubuntu (you can also install an alien-ed version of chkconfig, but that's not the point), one of them is sysv-rc-conf, the second one is rcconf.

sysv-rc-conf

sysv-rc-conf has the advantage that you can script with it, a simple

sysv-rc-conf apache2 on

Turns the apache service on at start up, and

sysv-rc-conf apache2 off

Turns it off, as it can be obviuos

Besides being a command line option, if you type just sysv-rc-conf, it fires up a text based management console, quite useful. I recommend you to use TERM=linux or TERM=xterm-color, using xterm alone, makes it look awry.

TERM=xterm-color sysv-rc-conf

Not so pretty but easily usable.

rcconf

Easy to use, it's the text counterpart to Ubuntu's graphical 'bum' Boot-Up Manager GUI. Just fire it up with rcconf

rcconf

The bad news it's that although this one looks a bit prettier all blue and stuff, it's not scriptable, that means it has no switches you can use from the command line. :( So sad. But it works great when using it interactively.

How to install ...

Well, as usual use apt-get or aptitude :)

aptitude install rcconf sysv-rc-conf -y

And that's it!

Bye!

See you next time.