Debian or Ubuntu Linux runlevel configuration tool to start service

by Vivek Gite · 8 comments

Q. Under Red Hat or Cent OS chkconfig command provides a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories. How do I control (or maintain Ubuntu runlevel) startup service under Debian or Ubuntu Linux with command line tool?

A. chkconfig is Redhat and friends only command. Debian or Ubuntu Linux offers different tools or command for same task.

Task: Command line tool to manage services / Ubuntu runlevel

update-rc.d automatically updates the System V style init script links /etc/rcrunlevel.d/NNname to scripts /etc/init.d/name. These are run by init when changing runlevels and are generally used to start and stop. For example turn on ssh service type the command:
# update-rc.d ssh defaultsOR$ sudo update-rc.d ssh defaults

Task: Remove service

Again use update-rc.d command:
# update-rc.d SERVICE-NAME removeOR$ sudo update-rc.d SERVICE-NAME remove

Task: Use Text based GUI Runlevel configuration tool to add or remove services

rcconf is Debian runlevel configuration tool. Rcconf allows you to control which services are started when the system boots up or reboots. It displays a menu of all the services which could be started at boot. The ones that are configured to do so are marked and you can toggle individual services on and off. If rcconf is not installed use apt-get command:
# apt-get install rcconfOR$ sudo apt-get install rcconf Now run rcconf and just follow on screen instructions:
# rcconf

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 8 comments… read them below or add one }

1 nathan 10.12.06 at 1:07 pm

small typo should be
$ sudo apt-get install rcconf
you are missing the a

2 nixcraft 10.12.06 at 4:41 pm

Nathan,

Typo is corrected. Thanks for the heads up :)

3 V.Balaviswanathan 04.27.09 at 2:38 pm

Thanks a lot for this info.. It worked for me

4 Bob 06.10.09 at 7:03 pm

Does all this still work on Ubuntu with their who upstart way of starting services that they use now?

5 Mark 06.29.09 at 10:23 am

Yeah this still works. Ubuntu 9.04 over here and still works. Im not sure for how long given that this functionality is only possible with upstart’s init.d compatibility mode.

6 Jacob 07.07.09 at 7:40 pm

thanks!

7 Balaviswanathan.V 09.09.09 at 6:13 pm

@Bob

In Ubuntu 9.04 , you need not have to install this package as we can start the service by

$ sudo service networking restart

Thanks and Regards

Bala

8 Sean 11.24.09 at 6:16 pm

So whats the runlevel change command or is that covered somewhere else.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous FAQ:

Next FAQ:

nixCraft FAQ PDF Collection Now Available To All