Debian or Ubuntu Linux runlevel configuration tool to start service

by on October 11, 2006 · 15 comments· LAST UPDATED September 27, 2007

in , ,

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

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 15 comments… read them below or add one }

1 nathan October 12, 2006 at 1:07 pm

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

Reply

2 nixCraft October 12, 2006 at 4:41 pm

Nathan,

Typo is corrected. Thanks for the heads up :)

Reply

3 V.Balaviswanathan April 27, 2009 at 2:38 pm

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

Reply

4 Bob June 10, 2009 at 7:03 pm

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

Reply

5 Mark June 29, 2009 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.

Reply

6 Jacob July 7, 2009 at 7:40 pm

thanks!

Reply

7 Balaviswanathan.V September 9, 2009 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

Reply

8 Sean November 24, 2009 at 6:16 pm

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

Reply

9 roger May 7, 2010 at 5:47 pm

Old post but still helpful and relevant. For new users, they may not notice running rcconf as non root will return a permission denied error, thus not changes. Best to run

sudo rcconf

Reply

10 Jack November 14, 2010 at 12:27 pm

Coming from a RHEL enviornment, chkconfig was an awesome way to maintain services and their run levels and this post was very helpful for me to find the Ubuntu equivalent (update-rc.d) in my new environment.

SIDE NOTE: apt-get install chkconfig will install chkconfig for us RHEL admins that can’t/refuse to make the jump to Ubuntu, but have to admin them.

Reply

11 Sebastian Colomar February 13, 2011 at 7:48 pm

Thank you :-)

Reply

12 Ali March 17, 2011 at 5:44 pm

Hi,

I have a Debian server and I installed a Tomcat on it. I used:
update-rc.d tomcat defaults
to install Tomcat as service but my Tomcat only started when I logging to my server with ssh.

how can I srat this service automatically?

Ali

Reply

13 paidjo.web.id June 1, 2012 at 4:11 am

it’s work, and thanks

Reply

14 titi corp June 4, 2012 at 9:54 pm

Thanks, this is useful information.

Reply

15 Teatro May 24, 2013 at 5:35 pm

Interesting, anyway i would like to know more about run levels in debian.

Reply

Leave a Comment

Tagged as: , , , , , , ,

Previous Faq:

Next Faq: