File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes How to stop automatically running services? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "How to stop automatically running services?" Watch "How to stop automatically running services?" New topic

How to stop automatically running services?

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3476

I have some services running automatically on Ubuntu 7.10 and in my case it is PostgreSQL database.
In general, how to forbid services from running automatically in Ubuntu?
Anand Hariharan

Joined: Aug 22, 2006
Posts: 257

Tweak scripts located at /etc/rcn.d

For a service such as postgresql, n = 3.

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

For Ubuntu, it is most probably Runlevel 2, and /etc/rc2.d/S??postgresql-* .
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950

The entries in the rc.n directories are aliases (softlinks) to the master scripts. You want to remove both the SnnServicename and the KnnServicename from all the numbered runlevel directories.

In Red Hat/Feodora, there's a magic comment in the initscript that specifies run level information (it's also done in SuSe, but slightly differently). You can turn services on and off via a gui command or via the chkconfig utility, like so:

chkconfig --level 345 postgresql off

Occasionally, Ubuntu adopts Red Hat stuff, so you might want to see if that works.

Customer surveys are for companies who didn't pay proper attention to begin with.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Ah yes - there is a helper-tool

with a different version number probably in your case.
jQuery in Action, 2nd edition
subject: How to stop automatically running services?
Similar Threads
Debugging a Connection Pool In services??
Linux Ubuntu Multi-boot
unable to find valid certification path to requested target
list of services deployed and running in server
Accessing File on UNIX