Don't rely on /etc/init.d being OpenRC
authorRoy Marples <roy@marples.name>
Mon, 12 Nov 2007 11:18:52 +0000 (11:18 +0000)
committerRoy Marples <roy@marples.name>
Mon, 12 Nov 2007 11:18:52 +0000 (11:18 +0000)
libc
named

diff --git a/libc b/libc
index 311d737df3052d2c11a4c26f2bcd874cfcdbe2a1..13a0521455354b684fe9fdb67eda5108ab0be5ba 100755 (executable)
--- a/libc
+++ b/libc
@@ -143,9 +143,12 @@ printf "${NEWCONF}" > "${RESOLVCONF}"/run/resolv.conf
 
 # Restart nscd if it's running
 if [ -x /etc/init.d/nscd ]; then
 
 # Restart nscd if it's running
 if [ -x /etc/init.d/nscd ]; then
-       /etc/init.d/nscd --nodeps --quiet conditionalrestart
-fi
-if [ -x /etc/rc.d/nscd ]; then
+       if [ -x /sbin/runscript ]; then
+               /etc/init.d/nscd --nodeps --quiet conditionalrestart
+       else
+               /etc/init.d/nscd restart
+       fi
+elif [ -x /etc/rc.d/nscd ]; then
        /etc/rc.d/nscd restart
 fi
 
        /etc/rc.d/nscd restart
 fi
 
diff --git a/named b/named
index b31282e72cbe4b3500f837c5e9a585de5dbac192..86cbf7c5ed74a75a33191782ea53d3d2559b60eb 100755 (executable)
--- a/named
+++ b/named
@@ -122,8 +122,12 @@ fi
 
 if [ "${RELOAD}" = "yes" ]; then
        # OpenRC style
 
 if [ "${RELOAD}" = "yes" ]; then
        # OpenRC style
-       if [ -x /etc/init.d/named -a -x /sbin/runscript ]; then
-               /etc/init.d/named --nodeps --quiet conditionalrestart
+       if [ -x /etc/init.d/named ]; then
+               if [ -x /sbin/runscript ]; then
+                       /etc/init.d/named --nodeps --quiet conditionalrestart
+               else
+                       /etc/init.d/named restart
+               fi
        fi
        # BSD RC style
        if [ -x /etc/rc.d/named -a -s /var/run/named/pid ]; then
        fi
        # BSD RC style
        if [ -x /etc/rc.d/named -a -s /var/run/named/pid ]; then