Accepting request 1041663 from home:kukuk:cleanup
- Remove avahi-daemon-check-dns.sh, avahi-daemon-check-dns-suse.patch and avahi-daemon.if-up Doesn't work since about 9 years and will not be executed on a fresh default installation anymore OBS-URL: https://build.opensuse.org/request/show/1041663 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/avahi?expand=0&rev=213
This commit is contained in:
parent
0b0c1ce0bf
commit
795e2c20fe
@ -1,37 +0,0 @@
|
||||
--- avahi-daemon-check-dns.sh.debian 2021-01-27 15:28:07.832795734 -0600
|
||||
+++ avahi-daemon-check-dns.sh 2021-01-27 15:39:35.364471899 -0600
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
|
||||
-RUNDIR="/var/run/avahi-daemon/"
|
||||
+RUNDIR="/var/run/avahi-daemon"
|
||||
DISABLE_TAG="$RUNDIR/disabled-for-unicast-local"
|
||||
NS_CACHE="$RUNDIR/checked_nameservers"
|
||||
|
||||
-AVAHI_DAEMON_DETECT_LOCAL=1
|
||||
+AVAHI_DAEMON_DETECT_LOCAL=yes
|
||||
|
||||
-test -f /etc/default/avahi-daemon && . /etc/default/avahi-daemon
|
||||
+test -f /etc/sysconfig/avahi && . /etc/sysconfig/avahi
|
||||
|
||||
-if [ "$AVAHI_DAEMON_DETECT_LOCAL" != "1" ]; then
|
||||
+if [ "$AVAHI_DAEMON_DETECT_LOCAL" != "yes" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
--- avahi-daemon.if-up.debian 2021-01-27 16:09:50.922179542 -0600
|
||||
+++ avahi-daemon.if-up 2021-01-27 16:11:54.942842665 -0600
|
||||
@@ -3,10 +3,10 @@
|
||||
# Don't run the avahi-daemon unicast local check while bringing up
|
||||
# the loopback device; it's not necessary until we bring up a real network
|
||||
# device
|
||||
-[ "$IFACE" != "lo" ] || exit 0
|
||||
+[ "$2" != "lo" ] || exit 0
|
||||
|
||||
# If we have an unicast .local domain, we immediately disable avahi to avoid
|
||||
# conflicts with the multicast IP4LL .local domain
|
||||
if [ -x /usr/lib/avahi/avahi-daemon-check-dns.sh ] ; then
|
||||
- exec /usr/lib/avahi/avahi-daemon-check-dns.sh
|
||||
+ sudo -u avahi -g avahi /usr/lib/avahi/avahi-daemon-check-dns.sh
|
||||
fi
|
@ -1,160 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# If we have an unicast .local domain, we immediately disable avahi to avoid
|
||||
# conflicts with the multicast IP4LL .local domain
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
|
||||
RUNDIR="/var/run/avahi-daemon/"
|
||||
DISABLE_TAG="$RUNDIR/disabled-for-unicast-local"
|
||||
NS_CACHE="$RUNDIR/checked_nameservers"
|
||||
|
||||
AVAHI_DAEMON_DETECT_LOCAL=1
|
||||
|
||||
test -f /etc/default/avahi-daemon && . /etc/default/avahi-daemon
|
||||
|
||||
if [ "$AVAHI_DAEMON_DETECT_LOCAL" != "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ensure_rundir() {
|
||||
if [ ! -d ${RUNDIR} ] ; then
|
||||
mkdir -m 0755 -p ${RUNDIR}
|
||||
chown avahi:avahi ${RUNDIR}
|
||||
fi
|
||||
}
|
||||
|
||||
log_disable_warning() {
|
||||
if [ -x /usr/bin/logger ]; then
|
||||
logger -p daemon.warning -t avahi <<EOF
|
||||
Avahi detected that your currently configured local DNS server serves
|
||||
a domain .local. This is inherently incompatible with Avahi and thus
|
||||
Avahi stopped itself. If you want to use Avahi in this network, please
|
||||
contact your administrator and convince him to use a different DNS domain,
|
||||
since .local should be used exclusively for Zeroconf technology.
|
||||
For more information, see http://avahi.org/wiki/AvahiAndUnicastDotLocal
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
dns_reachable() {
|
||||
# If there are no nameserver entries in resolv.conf there is no dns reachable
|
||||
$(grep -q nameserver /etc/resolv.conf) || return 1;
|
||||
|
||||
# If there is no local nameserver and no we have no global ip addresses
|
||||
# then we can't reach any nameservers
|
||||
if ! $(grep -E -q "nameserver 127.0.0.1|::1" /etc/resolv.conf); then
|
||||
if [ -x "$(which ip)" ]; then
|
||||
ADDRS=$(ip addr show scope global | grep inet)
|
||||
ROUTES=$(ip route show 0.0.0.0/0)
|
||||
elif [ -x "$(which ifconfig)" -a -x "$(which route)" ]; then
|
||||
# Get addresses of all running interfaces
|
||||
ADDRS=$(LC_ALL=C ifconfig | grep ' addr:')
|
||||
# Filter out all local addresses
|
||||
ADDRS=$(echo "${ADDRS}" | grep -E -v ':127|Scope:Host|Scope:Link')
|
||||
# Check we have a default route
|
||||
ROUTES=$(route -n | grep '^0.0.0.0 ')
|
||||
fi
|
||||
if [ -z "${ADDRS}" -o -z "${ROUTES}" ] ; then
|
||||
return 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
dns_has_local() {
|
||||
# Some magic to do tests
|
||||
if [ -n "${FAKE_HOST_RETURN}" ] ; then
|
||||
if [ "${FAKE_HOST_RETURN}" = "true" ]; then
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Use timeout when calling host as workaround for LP: #1752411
|
||||
OUT=`LC_ALL=C timeout 5 host -t soa local. 2>&1`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if echo "$OUT" | grep -E -vq 'has no|not found'; then
|
||||
return 0
|
||||
fi
|
||||
else
|
||||
# Checking the dns servers failed. Assuming no .local unicast dns, but
|
||||
# remove the nameserver cache so we recheck the next time we're triggered
|
||||
rm -f ${NS_CACHE}
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
dns_needs_check() {
|
||||
TMP_CACHE="${NS_CACHE}.$$"
|
||||
RET=0
|
||||
|
||||
ensure_rundir
|
||||
cat /etc/resolv.conf | grep "nameserver" | sort > ${TMP_CACHE} || return 0
|
||||
|
||||
if [ -e ${NS_CACHE} ]; then
|
||||
DIFFERENCE=$(diff -w ${NS_CACHE} ${TMP_CACHE})
|
||||
echo "${DIFFERENCE}" | grep -q '^>'
|
||||
ADDED=$?
|
||||
echo "${DIFFERENCE}" | grep -q '^<'
|
||||
REMOVED=$?
|
||||
# Avahi was disabled and no servers were removed, no need to recheck
|
||||
[ -e ${DISABLE_TAG} ] && [ ${REMOVED} -ne 0 ] && RET=1
|
||||
# Avahi was enabled and no servers were added, no need to recheck
|
||||
[ ! -e ${DISABLE_TAG} ] && [ ${ADDED} -ne 0 ] && RET=1
|
||||
fi
|
||||
|
||||
mv ${TMP_CACHE} ${NS_CACHE}
|
||||
return ${RET};
|
||||
}
|
||||
|
||||
|
||||
enable_avahi () {
|
||||
# no unicast .local conflict, so remove the tag and start avahi again
|
||||
if [ -e ${DISABLE_TAG} ]; then
|
||||
rm -f ${DISABLE_TAG}
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl start avahi-daemon.socket avahi-daemon.service || true
|
||||
elif [ -x "/etc/init.d/avahi-daemon" ]; then
|
||||
/etc/init.d/avahi-daemon start || true
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
disable_avahi () {
|
||||
[ -e ${DISABLE_TAG} ] && return
|
||||
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl stop avahi-daemon.socket avahi-daemon.service || true
|
||||
log_disable_warning
|
||||
elif [ -x "/etc/init.d/avahi-daemon" ]; then
|
||||
/etc/init.d/avahi-daemon stop || true
|
||||
log_disable_warning
|
||||
fi
|
||||
ensure_rundir
|
||||
touch ${DISABLE_TAG}
|
||||
}
|
||||
|
||||
if ! dns_reachable ; then
|
||||
# No unicast dns server reachable, so enable avahi
|
||||
enable_avahi
|
||||
# And blow away the dns cache, so we force a recheck when the interface comes
|
||||
# up again
|
||||
rm -f ${NS_CACHE}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if the dns needs checking..
|
||||
dns_needs_check || exit 0
|
||||
|
||||
if dns_has_local ; then
|
||||
# .local from dns server, disabling avahi
|
||||
disable_avahi
|
||||
else
|
||||
# no .local from dns server, enabling avahi
|
||||
enable_avahi
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Don't run the avahi-daemon unicast local check while bringing up
|
||||
# the loopback device; it's not necessary until we bring up a real network
|
||||
# device
|
||||
[ "$IFACE" != "lo" ] || exit 0
|
||||
|
||||
# If we have an unicast .local domain, we immediately disable avahi to avoid
|
||||
# conflicts with the multicast IP4LL .local domain
|
||||
if [ -x /usr/lib/avahi/avahi-daemon-check-dns.sh ] ; then
|
||||
exec /usr/lib/avahi/avahi-daemon-check-dns.sh
|
||||
fi
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 8 15:23:06 UTC 2022 - Thorsten Kukuk <kukuk@suse.com>
|
||||
|
||||
- Remove avahi-daemon-check-dns.sh, avahi-daemon-check-dns-suse.patch
|
||||
and avahi-daemon.if-up
|
||||
Doesn't work since about 9 years and will not be executed on a
|
||||
fresh default installation anymore
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 5 12:35:55 UTC 2022 - Johannes Segitz <jsegitz@suse.com>
|
||||
|
||||
|
22
avahi.spec
22
avahi.spec
@ -62,14 +62,10 @@ License: LGPL-2.1-or-later
|
||||
Group: System/Daemons
|
||||
URL: https://www.avahi.org/
|
||||
Source: https://avahi.org/download/%{_name}-%{version}.tar.gz
|
||||
# From http://packages.debian.org/sid/avahi-daemon http://ftp.debian.org/debian/pool/main/a/avahi/avahi_0.8-3.debian.tar.xz
|
||||
Source1: avahi-daemon-check-dns.sh
|
||||
# Copy of glib-2.0.m4 from glib2-devel to not depend on glib2-devel.
|
||||
Source4: avahi-glib-gettext.m4
|
||||
Source5: avahi.sysconfig
|
||||
Source6: avahi-autoipd.sysconfig
|
||||
# From http://packages.debian.org/sid/avahi-daemon http://ftp.debian.org/debian/pool/main/a/avahi/avahi_0.6.31-1.debian.tar.gz
|
||||
Source7: avahi-daemon.if-up
|
||||
Source9: avahi-autoipd.README.SUSE
|
||||
Source10: avahi-autoipd.if-up
|
||||
Source11: avahi-autoipd.if-down
|
||||
@ -85,8 +81,6 @@ Source103: avahi-rpmlintrc
|
||||
Patch0: avahi-gacdir.patch
|
||||
# PATCH-FIX-UPSTREAM avahi-desktop.patch bnc254654 Avahi#365 -- sbrabec@suse.cz
|
||||
Patch1: avahi-desktop.patch
|
||||
# PATCH-FEATURE-OPENSUSE avahi-daemon-check-dns-suse.patch bnc431704 sbrabec@suse.cz -- Port Debian avahi-daemon-check-dns.sh to SUSE, see also http://avahi.org/wiki/AvahiAndUnicastDotLocal
|
||||
Patch4: avahi-daemon-check-dns-suse.patch
|
||||
# PATCH-FIX-OPENSUSE avahi-add-resolv-conf-to-inotify.patch bsc#982317 boo#1194561 mgorse@suse.com -- reconfigure when resolv.conf changes.
|
||||
Patch19: avahi-add-resolv-conf-to-inotify.patch
|
||||
# PATCH-FIX-UPSTREAM add-IT_PROG_INTLTOOL.patch alarrosa@suse.com -- add IT_PROG_INTLTOOL so intltool works
|
||||
@ -420,6 +414,9 @@ DNS specifications for Zeroconf Computing.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# This is the avahi-discover command, only provided for the primary python3 flavor
|
||||
%package -n python3-avahi-gtk
|
||||
Summary: A set of Avahi utilities written in Python Using python-gtk
|
||||
@ -495,7 +492,6 @@ specifications for Zeroconf Computing.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{_name}-%{version}
|
||||
cp -a %{SOURCE1} %{SOURCE7} .
|
||||
cp -a %{SOURCE5} sysconfig.avahi
|
||||
sed "s:@docdir@:%{_docdir}:g" <%{SOURCE6} >sysconfig.avahi-autoipd
|
||||
cp -a %{SOURCE9} avahi-autoipd/README.SUSE
|
||||
@ -505,7 +501,6 @@ sed -ie "s/libevent-[0-9\.]*/libevent/" avahi-libevent.pc.in
|
||||
cp -a %{SOURCE12} service-type-database/build-db
|
||||
%patch0
|
||||
%patch1 -p1
|
||||
%patch4
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21 -p1
|
||||
@ -637,14 +632,7 @@ install -d %{buildroot}/%{_localstatedir}/run/avahi-daemon
|
||||
ln -s avahi-compat-libdns_sd/dns_sd.h %{buildroot}/%{_includedir}/
|
||||
ln -s avahi-compat-howl.pc %{buildroot}/%{_libdir}/pkgconfig/howl.pc
|
||||
install -d %{buildroot}/%{_prefix}/lib/avahi
|
||||
install avahi-daemon-check-dns.sh %{buildroot}/%{_prefix}/lib/avahi/
|
||||
install -d %{buildroot}%{_sysconfdir}/sysconfig/network/if-{up,down}.d
|
||||
# Note: We do not install the script to if-down.d. Only very obscure use
|
||||
# cases may fail. (And Debian does the same.)
|
||||
# (You would have an AUTOIP-only fallback network, then connect network
|
||||
# to network with .local in DNS without disconnecting from the fallback,
|
||||
# then disconnect from network with .local in DNS.)
|
||||
install avahi-daemon.if-up %{buildroot}%{_sysconfdir}/sysconfig/network/if-up.d/avahi-daemon
|
||||
install avahi-autoipd/avahi-autoipd.if-up %{buildroot}%{_sysconfdir}/sysconfig/network/if-up.d/avahi-autoipd
|
||||
install avahi-autoipd/avahi-autoipd.if-down %{buildroot}%{_sysconfdir}/sysconfig/network/if-down.d/avahi-autoipd
|
||||
install -d %{buildroot}/%{_localstatedir}/lib/avahi-autoipd
|
||||
@ -810,7 +798,6 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a
|
||||
%{_datadir}/dbus-1/interfaces/org.freedesktop.Avahi.*.xml
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.Avahi.service
|
||||
%dir %{_prefix}/lib/avahi
|
||||
%{_prefix}/lib/avahi/avahi-daemon-check-dns.sh
|
||||
%{_unitdir}/avahi-daemon.service
|
||||
%{_unitdir}/avahi-daemon.socket
|
||||
%{_unitdir}/avahi-dnsconfd.service
|
||||
@ -818,7 +805,6 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a
|
||||
# Common file for avahi-utils-gtk and python3-avahi-gtk:
|
||||
%dir %{_datadir}/avahi/
|
||||
%{_datadir}/avahi/interfaces
|
||||
%{_sysconfdir}/sysconfig/network/*/avahi-daemon
|
||||
%{_fillupdir}/sysconfig.avahi
|
||||
|
||||
%files lang -f %{name}.lang
|
||||
@ -854,6 +840,8 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a
|
||||
%attr(-,avahi-autoipd,avahi-autoipd)%{_localstatedir}/lib/avahi-autoipd
|
||||
%{_sbindir}/avahi-autoipd
|
||||
%{_sysconfdir}/avahi/avahi-autoipd.action
|
||||
%dir %{_sysconfdir}/sysconfig/network
|
||||
%dir %{_sysconfdir}/sysconfig/network/if-{down,up}.d
|
||||
%{_sysconfdir}/sysconfig/network/*/avahi-autoipd
|
||||
%{_fillupdir}/sysconfig.avahi-autoipd
|
||||
%{_sysusersdir}/avahi-autoipd.conf
|
||||
|
Loading…
Reference in New Issue
Block a user