Feedback

type to search

What's the proper way for disabling a daemon temporarily?

Asked by [ Editor ] , Edited by Fernando C. Estrada [ Admin ]

For some time I’ve been renaming init scripts whenever I needed to disable a daemon temporarily (for example, mv rsync rsync.disabled). I know that it can also be done with update-rc.d, but renaming an init script is quick, it doesn’t mess with the symlinks in /etc/rc?.d, and so it’s easy to revert (just change the renamed script to its original name). 


I’d like to know what’s the proper way for handling this, specially in Squeeze.

If I use update-rc.d to disable a daemon by removing all its symlinks, then I would have to remember exactly how it was configured in order to enable it again (start and stop sequence numbers plus runlevels). I guess there must be a better way. How do professional sysadmins disable system services temporarily?

or Cancel

4 answers

1

khomasuridze

You can also use tool called rcconf, great and easy to use program.

NN comments
alex
-

Thanks for your reply, that’s exactly what I was looking for. Unless someone knows of a better way for disabling / re-enabling system services, this is my accepted solution.

or Cancel
1

linulin [ Editor ]

Some packages allow controlling daemon startup behavior via relevant configuration files located in /etc/default directory, (although this method is not standardized). The following heuristic may help to discover the control options of interest:
egrep ‘ENABL|DISABL|START’ /etc/default/*
NN comments
alex
-

That seems like a good approach. However, many system services don’t provide the option of controlling the startup through /etc/default/. Maybe if there were a Debian policy enforcing startup control via /etc/default for all daemon packages, this would be standard enough to be useful for every case.

or Cancel
0

krimisek

sysv-rc-conf

NN comments
alex
-

sysv-rc-conf looks like an interesting option, similar to rcconf. Unfortunately, I tried to disable a service to see how it worked (hdparm) and the tool was unable to enable it again with its original settings (in other words, after enabling the service again, the symlinks in /etc/rc?.d are not the same that the original ones). But maybe I just didn’t issue the right combination of command line options.

krimisek
-
The order in rcX.d depends on headlines e. g.:

BEGIN INIT INFO

Provides: exim4

Required-Start: \$remote_fs \$syslog \$named \$network \$time

Required-Stop: \$remote_fs \$syslog \$named \$network

Should-Start: postgresql mysql clamav-daemon greylist spamassassin

Should-Stop: postgresql mysql clamav-daemon greylist spamassassin

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: exim Mail Transport Agent

Description: exim is a Mail Transport agent

END INIT INFO

It means that exim must start after services: \$remote_fs \$syslog \$named \$network \$time

Why do you want to have original order?

or Cancel

Your answer

You need to join Debian to complete this action, click here to do so.