[Resolvconf-devel] Bug#485523: resolvconf: mistakes runit for daemontools in dnscache update script
Alec Berryman
alec at thened.net
Tue Jun 10 01:29:28 UTC 2008
Package: resolvconf
Version: 1.40
Severity: normal
Tags: patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The code for restarting dnscache in the script /etc/resolvconf/update.d/dnscache
guesses between runit and daemontools by looking at dnscache's parent
directory. It assumes runit when it sees this directory is /etc/service.
However, the current daemontools package in main is configured to use
/etc/service, too.
I don't know the best way to handle this, but I've attached a patch that works
for me: if the directory is /etc/service, and only one of the two programs
exits, use that one.
- -- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages resolvconf depends on:
ii coreutils 6.10-3 The GNU core utilities
ii debconf [debconf-2.0] 1.5.22 Debian configuration management sy
ii lsb-base 3.2-11 Linux Standard Base 3.2 init scrip
resolvconf recommends no packages.
- -- debconf information:
* resolvconf/downup-interfaces:
resolvconf/link-tail-to-original: false
* resolvconf/linkify-resolvconf: true
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFITdj3Aud/2YgchcQRAh0MAJ4jhRogTlIhTVFqTLtkr0dN45O21wCgv9of
QFMWm6qwx5GK4OX7uQrnnn4=
=5xMo
-----END PGP SIGNATURE-----
-------------- next part --------------
diff --git a/resolvconf/update.d/dnscache b/resolvconf/update.d/dnscache
index e7b611d..4f8e914 100755
--- a/resolvconf/update.d/dnscache
+++ b/resolvconf/update.d/dnscache
@@ -107,8 +107,13 @@ for CACHE in $CACHES ; do
cp "$TMPFILE" "$CACHE/root/servers/@"
# Restart the cache if it's already running:
if [ "$(dirname "$CACHE")" = "/etc/service" ]; then
- # this is managed by runit
- [ "$SV_CMD" ] && "$SV_CMD" restart "$CACHE"
+ if [ "$SV_CMD" ]; then
+ # this is managed by runit
+ "$SV_CMD" restart "$CACHE"
+ else
+ # this is probably managed by daemontools
+ [ "$SVC_CMD" ] && "$SVC_CMD" -t "$CACHE"
+ fi
else
# this is probably managed by daemontools
[ "$SVC_CMD" ] && "$SVC_CMD" -t "$CACHE"
More information about the Resolvconf-devel
mailing list