openresolv: 3.5.6

This commit is contained in:
Neophytos 2013-11-08 02:06:51 +00:00
parent 53894ab884
commit 9626fdecc5
2 changed files with 110 additions and 11 deletions

View File

@ -1,5 +1,8 @@
# Maintainer: Neophytos Kolokotronis <tetris4 AT gmail DOT com>
# Contributions from Arch: https://projects.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/openresolv
pkgname=openresolv
pkgver=3.4.0
pkgver=3.5.6
pkgrel=1
pkgdesc="resolv.conf management framework (resolvconf)"
arch=(any)
@ -7,16 +10,29 @@ url="http://roy.marples.name/projects/openresolv"
license=('custom:BSD')
backup=(etc/resolvconf.conf)
provides=(resolvconf)
source=("http://roy.marples.name/downloads/openresolv/${pkgname}-${pkgver}.tar.bz2")
depends=(bash)
makedepends=(systemd)
source=("http://roy.marples.name/downloads/openresolv/${pkgname}-${pkgver}.tar.bz2"
fix-dnsmasq.patch)
md5sums=('ac03b7a52cf0f2040cc70df641f1baff'
'f2e6207621b284d1879bd004f8784b1e')
package() {
cd "$srcdir/$pkgname-$pkgver"
./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
make DESTDIR="$pkgdir" install
mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
sed -n '2,25{s:^# \?::;p}' resolvconf.in > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
prepare() {
cd $pkgname-$pkgver
patch -Np1 -i ../fix-dnsmasq.patch
sed -n '2,25{s:^# \?::;p}' resolvconf.in >LICENSE
}
md5sums=('37a916c5d8157cd7c0edbb8621573804')
build() {
cd $pkgname-$pkgver
./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/resolvconf \
--sbindir=/usr/bin
}
package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

View File

@ -0,0 +1,83 @@
diff --git i/dnsmasq.in w/dnsmasq.in
index 96b5593..384d9df 100644
--- i/dnsmasq.in
+++ w/dnsmasq.in
@@ -33,10 +33,9 @@
NL="
"
-: ${dnsmasq_pid:=/var/run/dnsmasq.pid}
-[ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid
: ${dnsmasq_service:=dnsmasq}
: ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@}
+: ${dnsmasq_reload:=/usr/bin/systemctl reload ${dnsmasq_service}}
newconf="# Generated by resolvconf$NL"
newresolv="$newconf"
@@ -182,7 +181,7 @@ if $changed; then
eval $dnsmasq_restart
fi
if $dbus; then
- $changed || kill -HUP $(cat "$dnsmasq_pid")
+ $changed || eval $dnsmasq_reload
# Send even if empty so old servers are cleared
if $dbus_ex; then
method=SetDomainServers
diff --git i/resolvconf.conf.5.in w/resolvconf.conf.5.in
index 81fe154..9b4f1bd 100644
--- i/resolvconf.conf.5.in
+++ w/resolvconf.conf.5.in
@@ -215,8 +215,8 @@ variables, documented below.
Location 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 dnsmasq_reload
+Command to reload the dnsmasq service.
.It Sy libc_service
Location of the libc service.
.It Sy libc_restart
@@ -229,10 +229,8 @@ Command to restart the named service.
Command to restart the pdnsd service.
.It Sy unbound_service
Location of the unbound service.
-.It Sy unbound_restart
-Command to restart the unbound service.
-.It Sy unbound_pid
-Location of the unbound pidfile.
+.It Sy unbound_reload
+Command to reload the unbound service.
.Sh SEE ALSO
.Xr resolv.conf 5
and
diff --git i/unbound.in w/unbound.in
index 4ee0da7..5e4a326 100644
--- i/unbound.in
+++ w/unbound.in
@@ -33,9 +33,8 @@
NL="
"
-: ${unbound_pid:=/var/run/unbound.pid}
: ${unbound_service:=unbound}
-: ${unbound_restart:=@RESTARTCMD ${unbound_service}@}
+: ${unbound_reload:=/usr/bin/systemctl reload-or-try-restart ${unbound_service}}
newconf="# Generated by resolvconf$NL"
for d in $DOMAINS; do
@@ -67,12 +66,5 @@ if [ ! -f "$unbound_conf" ] || \
[ "$(cat "$unbound_conf")" != "$(printf %s "$newconf")" ]
then
printf %s "$newconf" >"$unbound_conf"
- # If we can't sent a HUP then force a restart
- if [ -s "$unbound_pid" ]; then
- if ! kill -HUP $(cat "$unbound_pid") 2>/dev/null; then
- eval $unbound_restart
- fi
- else
- eval $unbound_restart
- fi
+ eval $unbound_reload
fi