[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#218530: Suboptimal conditional rune for initscripts



Package: debian-policy
Version: 3.6.1.0

While trying to merge an NMU to my package, I spotted an idiom
obviously copied from the policy manual:

        if [ -x /usr/sbin/invoke-rc.d ] ; then
		invoke-rc.d package <action>
        else
		/etc/init.d/package <action>
	fi

This would be better expressed as

	if type -p invoke-rc.d >/dev/null 2>&1; then
	...

This latter form will detect accurately whether invoke-rc.d is
available _on the current PATH_ as set by the sysadmin, and will
therefore allow somewhat greater flexibility to admins (eg, to install
invoke-rc.d separately in /usr/local before upgrading).

Ian.



Reply to: