[patch] if DHCP is used, also write a new /etc/resolv.conf

Bug #198376 reported by laga
4
Affects Status Importance Assigned to Milestone
ltsp (Ubuntu)
Fix Released
Wishlist
Alkis Georgopoulos

Bug Description

In certain cases, dhcp is used to configure the network interfaces in initramfs/scripts/ltsp_nbd. If the dhcpd also tells us about name servers, we should update /etc/resolv.conf accordingly.

This might break $stuff for people who've already hardcoded name servers in /opt/ltsp/$arch which are different from those given out by the dhcpd. But maybe those people might want to configure their dhcpd correctly instead.

=== modified file 'scripts/ltsp_nbd'
--- scripts/ltsp_nbd 2008-03-04 12:54:54 +0000
+++ scripts/ltsp_nbd 2008-03-04 14:20:13 +0000
@@ -109,6 +108,17 @@
         cp ./lts.conf ${rootmnt}/etc/
     fi

+
+ if [ -n "$IPV4DNS0" ]; then
+ echo "# created by the LTSP initramfs" > ${rootmnt}/etc/resolv.conf
+ echo "nameserver $IPV4DNS0" >> ${rootmnt}/etc/resolv.conf
+ fi
+
+ if [ -n "$IPV4DNS1" ]; then
+ echo "nameserver $IPV4DNS1" >> ${rootmnt}/etc/resolv.conf
+ fi
+
+
        [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
        run_scripts /scripts/nfs-bottom
        [ "$quiet" != "y" ] && log_end_msg

Revision history for this message
laga (laga) wrote :

It looks like ipconfig tells us that the secondary name server is 0.0.0.0 if it's not set. Or my dnsmasq is probably misconfigured. Anyways, there's the updated patch:

=== modified file 'scripts/ltsp_nbd'
--- scripts/ltsp_nbd 2008-03-04 12:35:43 +0000
+++ scripts/ltsp_nbd 2008-03-05 00:32:29 +0000
@@ -101,6 +109,17 @@
         cp ./lts.conf ${rootmnt}/etc/
     fi

+
+ if [ -n "$IPV4DNS0" ] && [ ! "$IPV4DNS0" = "0.0.0.0" ] ; then
+ echo "# created by the LTSP initramfs" > ${rootmnt}/etc/resolv.conf
+ echo "nameserver $IPV4DNS0" >> ${rootmnt}/etc/resolv.conf
+ fi
+
+ if [ -n "$IPV4DNS1" ] && [ ! "$IPV4DNS1" = "0.0.0.0" ]; then
+ echo "nameserver $IPV4DNS1" >> ${rootmnt}/etc/resolv.conf
+ fi
+
+
    [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
    run_scripts /scripts/nfs-bottom
    [ "$quiet" != "y" ] && log_end_msg

Revision history for this message
Oliver Grawert (ogra) wrote :

this should definately not happen inside the initramfs, the networking bootscripts for the rootsystem should care for it, if they dont, we need to fix it there

Daniel T Chen (crimsun)
Changed in ltsp:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

This has been fixed in http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/revision/1650
and released in LTSP 5.2 (Lucid).

Changed in ltsp (Ubuntu):
assignee: nobody → Alkis Georgopoulos (alkisg)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.