[Pkg-ltsp-devel] Bug#701647: ltsp-client-core: fails to write /etc/resolv.conf if package resolvconf is installed
Wolfgang Schweer
w.schweer at gmx.de
Mon Feb 25 17:45:48 UTC 2013
Package: ltsp-client-core
Version: 5.4.2-5
Severity: normal
Tags: upstream patch
Hi,
while testing ltsp setup for Debian Edu running fat clients I noticed,
that /etc/resolv.conf was't written like expected (by 10-resolv-conf).
This seems to be caused by $resolv not beeing writable.
Using the /etc/network/interface information worked for me. The script
has then to be run later, so renamed to 60-resolv-conf.
Find the script attached; here's the diff:
--- 10-resolv-conf 2012-06-27 00:00:00.000000000 +0200
+++ 60-resolv-conf 2013-02-21 20:05:04.000000000 +0100
@@ -27,24 +27,26 @@
# Apply the dns info that was received from dhcp or from lts.conf
if [ -n "$DNS_SERVER" ] || [ -n "$SEARCH_DOMAIN" ]; then
- # Deal with resolvconf
+ # Deal with resolvconf, use writable interface file.
if [ -x /sbin/resolvconf ] && ( [ -L /etc/resolv.conf ] || [ -e /var/lib/resolvconf/convert ] ); then
- mkdir -p /run/resolvconf/interface/
- resolv_method=resolvconf
- resolv=/run/resolvconf/interface/LTSP
- else
- resolv_method=static
- resolv=/etc/resolv.conf
- fi
-
- # Check if $resolv is writable
- if echo '# Generated by ltsp' 2>/dev/null > "$resolv"; then
if [ -n "$SEARCH_DOMAIN" ]; then
- echo "search $SEARCH_DOMAIN" >> "$resolv"
+ echo "dns-search $SEARCH_DOMAIN" >> /etc/network/interfaces
fi
for n in $DNS_SERVER; do
+ echo "dns-nameservers $n" >> /etc/network/interfaces
+ done
+ else
+ # Static case
+ resolv=/etc/resolv.conf
+ # Check if $resolv is writable
+ if echo '# Generated by ltsp' 2>/dev/null > "$resolv"; then
+ if [ -n "$SEARCH_DOMAIN" ]; then
+ echo "search $SEARCH_DOMAIN" >> "$resolv"
+ fi
+ for n in $DNS_SERVER; do
echo "nameserver $n" >> "$resolv"
done
+ fi
fi
fi
true
Additionally Debian Edu needs working DNS for KERBEROS. This can be
done by modifying /etc/nsswitch.conf without touching /etc/hosts. I
wonder if something similar would make sense to be integrated into
ltsp-client-core.
Find the script 70-edu-nsswitch attached.
This would IMHO close bug #613988.
Wolfgang
-------------- next part --------------
# set to defaults from DHCP if not specified in lts.conf
if [ -z "$DNS_SERVER" ]; then
for dns in $IPV4DNS0 $IPV4DNS1 ; do
# ignore nameserver of 0.0.0.0, which ipconfig may return if both
# nameservers aren't specified.
if [ "$dns" != "0.0.0.0" ]; then
DNS_SERVER="$DNS_SERVER $dns"
fi
done
fi
# If no DNS_SERVER was defined in lts.conf or in DHCP (e.g. IPAPPEND=3),
# check the LTSP server, gateway, and Google Public DNS.
if [ -z "$DNS_SERVER" ] && [ -x /usr/bin/dig ]; then
gateway=$(LANG=C ip route | sed -n 's/default via \([0-9.]*\).*/\1/p')
for dns in $SERVER $gateway 8.8.8.8; do
if dig +time=1 +tries=1 +short "@$dns" localhost >/dev/null 2>&1; then
DNS_SERVER="$dns"
break
fi
done
fi
if [ -z "$SEARCH_DOMAIN" ] && [ -n "$DNSDOMAIN" ]; then
SEARCH_DOMAIN="$DNSDOMAIN"
fi
# Apply the dns info that was received from dhcp or from lts.conf
if [ -n "$DNS_SERVER" ] || [ -n "$SEARCH_DOMAIN" ]; then
# Deal with resolvconf, use writable interface file.
if [ -x /sbin/resolvconf ] && ( [ -L /etc/resolv.conf ] || [ -e /var/lib/resolvconf/convert ] ); then
if [ -n "$SEARCH_DOMAIN" ]; then
echo "dns-search $SEARCH_DOMAIN" >> /etc/network/interfaces
fi
for n in $DNS_SERVER; do
echo "dns-nameservers $n" >> /etc/network/interfaces
done
else
# Static case
resolv=/etc/resolv.conf
# Check if $resolv is writable
if echo '# Generated by ltsp' 2>/dev/null > "$resolv"; then
if [ -n "$SEARCH_DOMAIN" ]; then
echo "search $SEARCH_DOMAIN" >> "$resolv"
fi
for n in $DNS_SERVER; do
echo "nameserver $n" >> "$resolv"
done
fi
fi
fi
true
-------------- next part --------------
# For Debian Edu diskless workstations (i.e. ltsp fat clients).
# As dns service is available, modify priority to make KERBEROS work.
if boolean_is_true "$LTSP_FATCLIENT"; then
sed -i s/compat/ldap\ compat/ /etc/nsswitch.conf
sed -i s/files\ my/dns\ files\ my/ /etc/nsswitch.conf
sed -i s/netgroups:\ *files/netgroups:\ \ \ \ \ \ ldap\ files/ nsswitch.conf
fi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-ltsp-devel/attachments/20130225/06995018/attachment.pgp>
More information about the Pkg-ltsp-devel
mailing list