init: check permissions on rc.d files
authorFelix Fietkau <nbd@openwrt.org>
Wed, 28 Nov 2007 02:36:14 +0000 (02:36 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 28 Nov 2007 02:36:14 +0000 (02:36 +0000)
We try to unconditionally execute /etc/rc.d/* files, even if they're
not executable - an easy way of temproarily disabling a service. When
this happens, we get a permission denied error on boot.

This change only tries to run execulable startup scripts.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
SVN-Revision: 9607

package/base-files/files/etc/init.d/rcS

index 61c1d6dab7ab1e3d11de2d9036b778e3f1ab0da6..b44f441c14c49234e0fc49a359972aa943e00174 100755 (executable)
@@ -3,6 +3,6 @@
 
 {
        for i in /etc/rc.d/$1*; do
-               $i $2 2>&1
+               [ -x $i ] && $i $2 2>&1
        done 
 } | logger -s -p 6 -t '' &