How do I run a Debian init.d script manually, not at boot?

Matthew Flaschen asked:

How do I stop an init.d server from running on boot, but still allow running it manually?

My answer:


See the man page for update-rc.d.

To stop a service from running at boot:

update-rc.d -f servicename remove

Or:

update-rc.d servicename stop 20 2 3 4 5 .

If you have Debian squeeze or later, or Ubuntu 12.10 or later:

update-rc.d servicename disable

To allow a service to run at boot:

update-rc.d servicename defaults

If you have Debian squeeze or later, or Ubuntu 12.10 or later:

update-rc.d servicename enable

To run the service manually:

service servicename start
service servicename restart

To stop the service manually:

service servicename stop

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.