Revert [606cfc2003] as the parsing code relies on the trailing newline.
authorRoy Marples <roy@marples.name>
Thu, 25 Feb 2016 20:55:43 +0000 (20:55 +0000)
committerRoy Marples <roy@marples.name>
Thu, 25 Feb 2016 20:55:43 +0000 (20:55 +0000)
named.in
resolvconf.in

index 3ed7a556139b2d02ebde20e646b24c666b86f487..de61906aef14a394dc4ebefc7d760dd10c981084 100644 (file)
--- a/named.in
+++ b/named.in
@@ -46,6 +46,11 @@ then
        fi
 fi
 : ${named_service:=named}
+
+: ${named_pid:=/var/run/$named_service.pid}
+[ -s "$named_pid" ] || named_pid=/var/run/$named_service/$named_service.pid
+[ -s "$named_pid" ] || unset named_pid
+
 newoptions="# Generated by resolvconf$NL"
 newzones="$newoptions"
 
@@ -100,7 +105,14 @@ if [ -n "$named_zones" ]; then
        fi
 fi
 
+# Try to send SIGHUP first
+if $changed && [ -s "$named_pid" ]; then
+       echo "SENDING HUP"
+       kill -SIGHUP $(cat "$named_pid") && changed=false
+fi
+
 if $changed; then
+       echo "RESTARTING"
        if [ -n "$named_restart" ]; then
                eval $named_restart
        elif [ -n "$RESTARTCMD" ]; then
index 95d20e16e4f2e077fa6437d3c50c92cfdab41c1b..6b76af8ddebf9ed658f703d3dede675d0608b5e7 100644 (file)
@@ -421,13 +421,8 @@ list_resolv()
                if [ "$cmd" = i -o "$cmd" = "-i" ]; then
                        printf %s "$i "
                else
-                       # To avoid trailing a blank line at the end
-                       if $excl; then
-                               excl=false
-                       else
-                               echo
-                       fi
                        echo_resolv "$i"
+                       echo
                fi
                [ $? = 0 -a "$retval" = 1 ] && retval=0
        done