Debian or Ubuntu Linux runlevel configuration tool to start service

Posted on in Categories , , last updated September 27, 2007

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

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Share this on (or read 15 comments/add one below):

15 comment

  1. 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.

  2. 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

  3. 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.

  4. 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

Leave a Comment