Kubuntu 9.10—Services


This post is intended to help you to understand how services work in Kubuntu.  Essentially they are the same as in Windows.  A service is an application or program that is running in the background.  It’s waiting for commands—either by the user, or other programs or scheduled tasks, and will execute those commands when it receives them.  This post will help you to understand how to start them, stop them, and restart them.  And I will touch on how to prevent them from starting in the first place.

Starting Services:

If you are in KDE or Gnome, you can start some services by going into the Service Manager Utility.  This can be reached by clicking on the “K” –> System Settings (or Applications, System Settings, System Settings) –> Advanced –> Service Manager. (In Gnome, you will go to Applications –> Preferences –> and look for Service Manager or Service Configuration Utility).

If it’s an On Demand service, it can’t be started unless it’s required by something.  However, if it’s listed in the Startup Services list, you can start it by clicking on it, then clicking Start.

If you’re in the command line, simply type /etc/init.d/servicename start  (you may have to type sudo for it to work- sudo /etc/init.d/servicename start for example). Also, the services may be located in /etc/rc.d/init.d instead of /etc/init.d.  So, you’ll want to find out which system your version uses, and add that to the command.

Stopping a service:

In the desktop manager (KDE or Gnome) you follow the same procedure as listed above for starting a service, only clicking Stop instead of start.

In the command line, it’s the same procedure as the start method.  However, instead of start, you put stop.

Disabling a service:

Disabling the service prevents it from starting up when you reboot the computer next time.  This is especially useful if you have services that are not being used (such as the httpd service for apache web servers and ftp services that you probably aren’t running).

If you’re in KDE or Gnome, you’ll go to the same location that you were in to start or stop the service.  Like the other two, you cannot do anything with the “On Demand” services, as they are required by some application or other service to run.  However, you can prevent the startup services from running.  Simply remove the check mark in the box next to the service, and apply.  You don’t have to reboot immediately, as you can use the “Stop” button to kill the service for the time being.

In the command line, it’s a bit more evolved than simply unchecking the service.  You need to look in the /etc/rc.d directories (they will be labeled with rc0 rc1 rc2 etc) for any links to the service.  Then you need to delete those links.  This can be accomplished by using the command: 

update-rc.d -f servicename remove

Note that the next time a version of the package that the service is referring to is installed, the service will most likely be re enabled in these directories.  So, you’ll have to do this again.

The way to tell in those directories if a service has been disabled or not is by using cd to enter the directory (for example cd /etc/rc0.d ) and then using ls to see what the names are in the directory.  If they start with an “S” then they are enabled.  If they have a “K” then they are disabled (or killed).

The information that I presented here comes from http://www.unixtutorial.org/2009/01/disable-service-startup-in-ubuntu/ amongst other sources.  Also note that you may have to look in Applications –> Preferences for the Service Manager in Gnome.  However the information is still the same.

Have a great day:)

Patrick.

Leave a comment

Your email address will not be published. Required fields are marked *