summaryrefslogtreecommitdiffstats
path: root/contrib/openresolv/named.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/openresolv/named.in')
-rw-r--r--contrib/openresolv/named.in24
1 files changed, 18 insertions, 6 deletions
diff --git a/contrib/openresolv/named.in b/contrib/openresolv/named.in
index 43ceabb..2083ea5 100644
--- a/contrib/openresolv/named.in
+++ b/contrib/openresolv/named.in
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (c) 2007-2012 Roy Marples
+# Copyright (c) 2007-2016 Roy Marples
# All rights reserved
# named subscriber for resolvconf
@@ -35,18 +35,22 @@ NL="
# Platform specific kludges
if [ -z "$named_service" -a -z "$named_restart" -a \
- -d "@RCDIR@" -a ! -x "@RCDIR@"/named ]
+ -d "$RCDIR" -a ! -x "$RCDIR"/named ]
then
- if [ -x "@RCDIR@"/bind9 ]; then
+ if [ -x "$RCDIR"/bind9 ]; then
# Debian and derivatives
named_service=bind9
- elif [ -x "@RCDIR@"/rc.bind ]; then
+ elif [ -x "$RCDIR"/rc.bind ]; then
# Slackware
named_service=rc.bind
fi
fi
: ${named_service:=named}
-: ${named_restart:=@RESTARTCMD ${named_service}@}
+
+: ${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"
@@ -101,6 +105,14 @@ if [ -n "$named_zones" ]; then
fi
fi
+# named does not seem to work with SIGHUP which is a same
if $changed; then
- eval $named_restart
+ if [ -n "$named_restart" ]; then
+ eval $named_restart
+ elif [ -n "$RESTARTCMD" ]; then
+ set -- ${named_service}
+ eval $RESTARTCMD
+ else
+ @SBINDIR@/resolvconf -r ${named_service}
+ fi
fi
OpenPOWER on IntegriCloud