Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/ROY]: src/external/bsd/openresolv/dist Import openresolv-3.8.0 with the ...



details:   https://anonhg.NetBSD.org/src/rev/2a0aed990fe4
branches:  ROY
changeset: 454318:2a0aed990fe4
user:      roy <roy%NetBSD.org@localhost>
date:      Mon Apr 11 10:40:21 2016 +0000

description:
Import openresolv-3.8.0 with the following changes:
  *  init system detection moved from configure into resolvconf.
  *  Fixed multiple domains not bein separated correctly.

diffstat:

 external/bsd/openresolv/dist/dnsmasq.in           |   13 +-
 external/bsd/openresolv/dist/libc.in              |   12 +-
 external/bsd/openresolv/dist/named.in             |   24 ++-
 external/bsd/openresolv/dist/resolvconf.8.in      |   70 ++++---
 external/bsd/openresolv/dist/resolvconf.conf.5.in |   10 +-
 external/bsd/openresolv/dist/resolvconf.in        |  184 +++++++++++++++++----
 external/bsd/openresolv/dist/unbound.in           |   19 +-
 7 files changed, 247 insertions(+), 85 deletions(-)

diffs (truncated from 596 to 300 lines):

diff -r fa7fa3f5e0f6 -r 2a0aed990fe4 external/bsd/openresolv/dist/dnsmasq.in
--- a/external/bsd/openresolv/dist/dnsmasq.in   Mon Feb 22 10:07:26 2016 +0000
+++ b/external/bsd/openresolv/dist/dnsmasq.in   Mon Apr 11 10:40:21 2016 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2012 Roy Marples
+# Copyright (c) 2007-2016 Roy Marples
 # All rights reserved
 
 # dnsmasq subscriber for resolvconf
@@ -37,7 +37,6 @@
 [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid
 [ -s "$dnsmasq_pid" ] || unset dnsmasq_pid
 : ${dnsmasq_service:=dnsmasq}
-: ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@}
 newconf="# Generated by resolvconf$NL"
 newresolv="$newconf"
 
@@ -180,7 +179,15 @@
 fi
 
 if $changed; then
-       eval $dnsmasq_restart
+       # dnsmasq does not re-read the configuration file on SIGHUP
+       if [ -n "$dnsmasq_restart" ]; then
+               eval $dnsmasq_restart
+       elif [ -n "$RESTARTCMD" ]; then
+               set -- ${dnsmasq_service}
+               eval $RESTARTCMD
+       else
+               @SBINDIR@/resolvconf -r ${dnsmasq_service}
+       fi
 fi
 if $dbus; then
        if [ -s "$dnsmasq_pid" ]; then
diff -r fa7fa3f5e0f6 -r 2a0aed990fe4 external/bsd/openresolv/dist/libc.in
--- a/external/bsd/openresolv/dist/libc.in      Mon Feb 22 10:07:26 2016 +0000
+++ b/external/bsd/openresolv/dist/libc.in      Mon Apr 11 10:40:21 2016 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2014 Roy Marples
+# Copyright (c) 2007-2016 Roy Marples
 # All rights reserved
 
 # libc subscriber for resolvconf
@@ -97,7 +97,6 @@
 fi
 : ${resolv_conf:=/etc/resolv.conf}
 : ${libc_service:=nscd}
-: ${libc_restart:=@RESTARTCMD ${libc_service}@}
 : ${list_resolv:=@SBINDIR@/resolvconf -l}
 if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then
        resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)"
@@ -229,7 +228,14 @@
 
 # Create our resolv.conf now
 (umask 022; printf %s "$newconf" >"$resolv_conf")
-eval $libc_restart
+if [ -n "$libc_restart" ]; then
+       eval $libc_restart
+elif [ -n "$RESTARTCMD" ]; then
+       set -- ${libc_service}
+       eval $RESTARTCMD
+else
+       @SBINDIR@/resolvconf -r ${libc_service}
+fi
 
 retval=0
 # Notify users of the resolver
diff -r fa7fa3f5e0f6 -r 2a0aed990fe4 external/bsd/openresolv/dist/named.in
--- a/external/bsd/openresolv/dist/named.in     Mon Feb 22 10:07:26 2016 +0000
+++ b/external/bsd/openresolv/dist/named.in     Mon Apr 11 10:40:21 2016 +0000
@@ -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 @@
 
 # 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 @@
        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
diff -r fa7fa3f5e0f6 -r 2a0aed990fe4 external/bsd/openresolv/dist/resolvconf.8.in
--- a/external/bsd/openresolv/dist/resolvconf.8.in      Mon Feb 22 10:07:26 2016 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.8.in      Mon Apr 11 10:40:21 2016 +0000
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2007-2015 Roy Marples
+.\" Copyright (c) 2007-2016 Roy Marples
 .\" All rights reserved
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 27, 2015
+.Dd February 23, 2016
 .Dt RESOLVCONF 8
 .Os
 .Sh NAME
@@ -125,24 +125,28 @@
 on the
 .Ar interface .
 .Pp
-Here are some more options that
-.Nm
-has:-
+Here are some options for the above commands:-
 .Bl -tag -width indent
-.It Fl I
-Initialise the state directory
-.Pa @VARDIR@ .
-This only needs to be called if the initial system boot sequence does not
-automatically clean it out; for example the state directory is moved
-somewhere other than
-.Pa /var/run .
-If used, it should only be called once as early in the system boot sequence
-as possible and before
-.Nm
-is used to add interfaces.
 .It Fl f
 Ignore non existant interfaces.
 Only really useful for deleting interfaces.
+.It Fl m Ar metric
+Set the metric of the interface when adding it, default of 0.
+Lower metrics take precedence.
+This affects the default order of interfaces when listed.
+.It Fl p
+Marks the interface
+.Pa resolv.conf
+as private.
+.It Fl x
+Mark the interface
+.Pa resolv.conf
+as exclusive when adding, otherwise only use the latest exclusive interface.
+.El
+.Pp
+.Nm
+has some more commands for general usage:-
+.Bl -tag -width indent
 .It Fl i Ar pattern
 List the interfaces and protocols, optionally matching
 .Ar pattern ,
@@ -157,14 +161,6 @@
 .Ar pattern
 is specified then we list the files for the interfaces and protocols
 that match it.
-.It Fl m Ar metric
-Set the metric of the interface when adding it, default of 0.
-Lower metrics take precedence.
-This affects the default order of interfaces when listed.
-.It Fl p
-Marks the interface
-.Pa resolv.conf
-as private.
 .It Fl u
 Force
 .Nm
@@ -172,15 +168,31 @@
 .Nm
 does not update the subscribers when adding a resolv.conf that matches
 what it already has for that interface.
-.It Fl x
-Mark the interface
-.Pa resolv.conf
-as exclusive when adding, otherwise only use the latest exclusive interface.
 .El
 .Pp
 .Nm
-also has some options designed to be used by its subscribers:-
+also has some commands designed to be used by it's subscribers and
+system startup:-
 .Bl -tag -width indent
+.It Fl I
+Initialise the state directory
+.Pa @VARDIR@ .
+This only needs to be called if the initial system boot sequence does not
+automatically clean it out; for example the state directory is moved
+somewhere other than
+.Pa /var/run .
+If used, it should only be called once as early in the system boot sequence
+as possible and before
+.Nm
+is used to add interfaces.
+.It Fl R
+Echo the command used to restart a service.
+.It Fl r Ar service
+If the
+.Ar service
+is running then restart it.
+If the service does not exist or is not running then zero is returned,
+otherwise the result of restarting the service.
 .It Fl v
 Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can
 configure the resolver easily.
diff -r fa7fa3f5e0f6 -r 2a0aed990fe4 external/bsd/openresolv/dist/resolvconf.conf.5.in
--- a/external/bsd/openresolv/dist/resolvconf.conf.5.in Mon Feb 22 10:07:26 2016 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.conf.5.in Mon Apr 11 10:40:21 2016 +0000
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 21, 2016
+.Dd February 23, 2016
 .Dt RESOLVCONF.CONF 5
 .Os
 .Sh NAME
@@ -284,23 +284,23 @@
 .Pp
 .Bl -tag -width indent
 .It Sy dnsmasq_service
-Location of the dnsmasq service.
+Name of the dnsmasq service.
 .It Sy dnsmasq_restart
 Command to restart the dnsmasq service.
 .It Sy dnsmasq_pid
 Location of the dnsmasq pidfile.
 .It Sy libc_service
-Location of the libc service.
+Name of the libc service.
 .It Sy libc_restart
 Command to restart the libc service.
 .It Sy named_service
-Location of the named service.
+Name of the named service.
 .It Sy named_restart
 Command to restart the named service.
 .It Sy pdnsd_restart
 Command to restart the pdnsd service.
 .It Sy unbound_service
-Location of the unbound service.
+Name of the unbound service.
 .It Sy unbound_restart
 Command to restart the unbound service.
 .It Sy unbound_pid
diff -r fa7fa3f5e0f6 -r 2a0aed990fe4 external/bsd/openresolv/dist/resolvconf.in
--- a/external/bsd/openresolv/dist/resolvconf.in        Mon Feb 22 10:07:26 2016 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.in        Mon Apr 11 10:40:21 2016 +0000
@@ -25,9 +25,12 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 RESOLVCONF="$0"
+OPENRESOLV_VERSION="3.8.0"
 SYSCONFDIR=@SYSCONFDIR@
 LIBEXECDIR=@LIBEXECDIR@
 VARDIR=@VARDIR@
+RCDIR=@RCDIR@
+RESTARTCMD=@RESTARTCMD@
 
 # Disregard dhcpcd setting
 unset interface_order state_dir
@@ -71,55 +74,45 @@
 usage()
 {
        cat <<-EOF
-       Usage: ${RESOLVCONF##*/} [options]
+       Usage: ${RESOLVCONF##*/} [options] command [argument]
 
        Inform the system about any DNS updates.
 



Home | Main Index | Thread Index | Old Index