About nixCraft

Topics

Ubuntu / Debian Linux: Services Configuration Tool to Start / Stop System Services

Posted by Vivek Gite [Last updated: April 18, 2008]

Your Debian / Ubuntu Linux box security depends upon access to system services (one of many aspects). For example, you may need to provide a web server (Apache service) to serve web pages. However, if you do not need use a service, you should always turn off all unused services to avoid exploits.

Traditionally, Debian provided various tools to manage services. There are various methods for managing access to system services:
a) /etc/init.d/service
b) rcconf
c) update-rc.d etc

Under Red hat and Centos Linux you can use chkconfig command (ntsysv command) to configure Sys V style init script links. There is also service command to stop / start / restart services.

So if you are addicted to the service command under RHEL / CentOS / Mandriva Linux and have wondered what to do in Debian / Ubuntu, Linux try sysvconfig package.

sysvconfig - Services Startup Configuration Tool

Debian and Ubuntu Linux also offers service command. It can be used to execute System V style init script stored at /etc/init.d/service-name { start|stop|restart|action }. This is good if you grown up with Red hat. This tool is equivalent to update-rc.d and invoke-rc.d (rcconf and others).

sysvconfig package

First, install sysvconfig package:
$ sudo apt-get install sysvconfig

To start / restart / stop service, use the following syntax:
$ sudo service {service-name} restart <-- Restart service
$ sudo service {service-name} stop <-- Stop service
$ sudo service {service-name} start <-- Start service

For example to stop apache service, enter:
$ sudo service apache stop

sysvconfig command

This is a text-based application that allows you to configure which services are started at boot time for each runlevel. It is simple interface for configuring runlevels. sysvconfig is just like ntsysv under Red hat Linux. It has dialog based interactive, menus to help automate setting up Sys V style init script links:

To start Sys V editor, enter:
$ sudo sysvconfig &
sysvconfig - configure Sys V style init script links under Debian / Ubuntu Linux
(Fig 01: sysvconfig in action - startup screen with menus)

You can enable or disable any system services:
sysvconfig - enable or disable any system services under Debian / Ubuntu Linux
(Fig 02: sysvconfig in action - Enable or Disable system services)

Please note that when you configure a new service using these tools, you may need to reconfigure firewall as well to open required ports.

Further readings

=> Read the man pages for sysvconfig and service command.

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. hayalci Says:

    sysv-rc-conf is another good utility to configure services. it is ncurses based and if you run it in detailed view, you can change startup order, you can delete links completely instead of S->K change.

  2. RD Says:

    ESR also contributed a “chkconfig” script for RH users, it’s posted to the Upstart development list sometime this summer, and is in the archives.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

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

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , ,

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.