[Pkg-sysvinit-devel] Bug#546532: sysv-rc: invoke-rc.d does not default to a sensitive behaviour when no start o stop symlink is found

Raphael Geissert geissert at debian.org
Sun Sep 13 21:00:29 UTC 2009


Package: sysv-rc
Version: 2.86.ds1-65
Severity: minor
Tags: patch

Hi,

invoke-rc.d(8) states:
> invoke-rc.d  itself only pays attention to the current runlevel; it
> will block any attempts to start a service *in a runlevel in which the
> service is disabled*.  Other policies are implemented with the use of the
> policy-rc.d  helper, and are only available if /usr/sbin/policy-rc.d is
> installed in the system.

And although update-rc.d(8) says that it is a common administration error to 
delete a start symlink instead of renaming it to make it a stop symlink, the 
default behaviour of invoke-rc.d in that case is not sensitive, and leads to 
the init script being executed.

Example:
Package foo ships an init script called foo and starts on the default 
runlevels; but the administrator wants to manually start it, never 
automatically, so she rm /etc/rc*.d/S*foo (because she is not aware of the 
warning of update-rc.d). The foo package also ships a logrotate rule, which 
correctly calls "invoke-rc.d foo restart" after the logs have been rotated.
Given that there are no start or stop symlinks, the RC variable of invoke-rc.d 
is left empty which later leads to invoke-rc.d executing the init script.

I believe the sensitive action to do in these situations is simply refuse to 
call the init script. The patch below does exactly that.

--- unpacked/usr/sbin/invoke-rc.d       2009-09-05 15:28:52.000000000 -0500
+++ /usr/sbin/invoke-rc.d       2009-09-13 15:43:56.000000000 -0500
@@ -367,6 +367,8 @@
        RC=101
     elif testexec ${SSLINK} ; then
        RC=104
+    else
+       RC=101
     fi
   ;;
 esac

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net





More information about the Pkg-sysvinit-devel mailing list