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:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- My 10 UNIX Command Line Mistakes
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email FAQ to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: 09/27/07



{ 8 comments… read them below or add one }
small typo should be
$ sudo apt-get install rcconf
you are missing the a
Nathan,
Typo is corrected. Thanks for the heads up :)
Thanks a lot for this info.. It worked for me
Does all this still work on Ubuntu with their who upstart way of starting services that they use now?
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.
thanks!
@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
So whats the runlevel change command or is that covered somewhere else.