job.answiz.com
  • 4
Votes
name
name Punditsdkoslkdosdkoskdo

Disables a services from starting at all runlevel?

I have a service foo which currently starts at runlevel 3 and above. How can I stop it from doing so, without using update-rc.d foo stop 3 ., which (if I understand it correctly) would turn off the service at each runlevel change.

(ie., if I was at runlevel 1 and enabled foo, then when I changed to runlevel 3 it would be disabled, no?)

Running Debian GNU/Linux Lenny.

Run this command

apt-get install rcconf

Once installed, run rcconf in SSH and you will receive a dialog box displaying all services set to run on boot. Select the ones by pressing Space to disable/enable the particular and you're done, simpley click on Ok and that service wont bother to start again on next boot. Being using this for years. Very handy tool for Debian/Ubuntu users like me.

  • 0
Reply Report

entOS/RHEL provides us with a simple command-line tool (chkconfig) for managing services that are started during the various runlevels of your system. chkconfig requires some additional comment lines in the actual init script to tell it in which run levels the service should be started, and when, relatively, the service should be started during the initialization of the run level. (init scripts are processed in a specific order to ensure that services dependent on others are started after the services they depend on.) These lines, taken from the httpd init script, are as follows:

# chkconfig: 345 85 15
# description: Apache is a World Wide Web server.  It is used to serve
# HTML files and CGI.
  • 0
Reply Report

The "stop" term does not prevent the daemon from starting but rather shuts it down while entering the specified runlevel.

If you just want to remove a service/daemon from a single runlevel, update-rc.d as pointed out bei freiheit or simply remove the symlinkfrom /etc/rcX.d/, where X is your runlevel. If you don't want the service to start automatically, update-rc.d -f foo remove will do the trick.

  • 4
Reply Report