Only restart named if it's running (BSD) and only use OpenRC options if /sbin/runscri...
authorRoy Marples <roy@marples.name>
Sun, 11 Nov 2007 00:00:54 +0000 (00:00 +0000)
committerRoy Marples <roy@marples.name>
Sun, 11 Nov 2007 00:00:54 +0000 (00:00 +0000)
named

diff --git a/named b/named
index df7a196ca17f16413048c366fff56aff9b45284b..b31282e72cbe4b3500f837c5e9a585de5dbac192 100755 (executable)
--- a/named
+++ b/named
@@ -122,12 +122,12 @@ fi
 
 if [ "${RELOAD}" = "yes" ]; then
        # OpenRC style
-       if [ -x /etc/init.d/named ; then
+       if [ -x /etc/init.d/named -a -x /sbin/runscript ]; then
                /etc/init.d/named --nodeps --quiet conditionalrestart
        fi
        # BSD RC style
-       if [ -x /etc/rc.d/named ]; then
-               /etc/rc.d/named restart
+       if [ -x /etc/rc.d/named -a -s /var/run/named/pid ]; then
+               kill -0 $(cat /var/run/named/pid) && /etc/rc.d/named restart
        fi
 fi