Ticket #2056 (assigned defect)

Opened 9 years ago

Last modified 5 months ago

/etc/resolv.conf is empty on first boot

Reported by: rwhitby Owned by: john_lee
Priority: normal Milestone:
Component: Distro Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: no PatchReviewResult:
Reproducible: always

Description

Scenario:

Flash a new ASU or FSO distribution, and connect to it via USB networking (since it's a GTA01, so there is no wireless, and GPRS and Bluetooth don't connect to anything out of the box).

Type "opkg update". If /etc/resolv.conf had sensible contents it would work. However, /etc/resolv.conf is empty, so it doesn't.

This has been mentioned countless times on many OM mailing lists, but it seems that no-one has ever officially reported it as a bug.

Change History

comment:1 Changed 9 years ago by newkirk

A simple fix, provided resolvconf is installed and managing /etc/resolv.conf, (This appears to be the case with 2007/2008/ASU/FDOM, but not Raster's image, uncertain about others) is to add this line to /etc/network/interfaces in the 'usb0' stanza:
up echo 'nameserver a.b.c.d' | resolvconf -a usb0

Clearly the actual destination nameserver's IP is a separate point for potential debate, but the previous standard was the IP of the desktop to which usb0 leads, 192.168.0.200 by current default. Another reasonable choice would be opendns.org or another free publicly-accessible caching DNS service.

Also best to put 'usb*' near the end of /etc/resolvconf/interface-order just above '*' complete wildcard entry, though it will be caught by that wildcard if not explicitly listed.

Also clearly, if one network interface's "standard" config utilizes resolvconf to manage nameservers, ALL need to do so or problems ensue.

comment:2 Changed 9 years ago by zecke

  • Owner changed from raster to julian_chu
  • Component changed from Network Manager to Distro

The other side of the story is this. usb0 adds a default route and when you add a DNS entry to any kind of name resolving will take a while until it times out. This was a big hit for assassin as it added a huge (several seconds) delay to have a opkg update fail. My assumption was 192.168.0.200 as nameserver is wrong most of the time anyway and added complication (koen did a similar fix in OE) and that with wlan one would have dhcp most of the time anyway.

Any ideas how to make both sides happy? Have a default DNS server but still fail fast in case usb0 is not routed to the world?

comment:3 Changed 9 years ago by newkirk

If wlan utilizes resolvconf, then resolvconf itself will ensure that the DNS servers associated with the wlan connection are used, NOT the DNS server(s) associated with usb0. That's much of its purpose.

Whatever active interface (assuming they all interact with resolvconf, not difficult) is highest in the list /etc/resolvconf/interface-order will have its DNS servers inserted in /etc/resolv.conf - lower-priority (lower in the list) interfaces will NOT, until/unless the higher-priority interface goes down. (Again, presuming it cooperates with resolvconf)

The result is that usb0 tells resolvconf "use nameserver 192.168.0.254", and resolvconf sets up to use that nameserver initially. Then eth0 comes online, and DHCP provides DNS, so eth0 tells resolvconf "use nameserver 172.31.254.2", and resolvconf stuffs that into /etc/resolv.conf INSTEAD of 192.168.0.254. Then eth0 goes back down, and resolvconf knows to restore the nameserver associated with usb0, since no higher-priority interface is available.

I agree that 192.168.0.200 as nameserver is just offloading the headache on the user, who must then deal with it in some fashion on the desktop - not entirely unreasonable for linux developers, but it IS entirely unreasonable for the run-of-the-mill phone user who just wants to upgrade some things.

The 'simplest' solution is just to hardcode publicly-accessible caching DNS server(s) like opendns.org in etc/resolv.conf. But unless all interfaces leave it alone, it will still get broken when, for instance, GPRS ppp stuffs the cell-carrier's DNS servers in there, then purges them (or not!) on disconnect.

comment:4 Changed 9 years ago by zecke

Let me repeat (I might be wrong):

  • usb0 is _on_ by default. Regardless of a usb cable being plugged or not. (defaultroute)
  • having a dns entry (using resolvconf or not) /etc/resolv.conf (no matter where this content comes from)
  • DNS times out after ~60 seconds by default (wlan off, bluetooth off, usb unplugged)

is there a way to make both sides happy?

comment:5 follow-up: ↓ 6 Changed 9 years ago by newkirk

Sorry, I didn't understand you were speaking to the case where NO valid network connection exists, but route and DNS via usb0 were still active.

I ran some tests with USB unplugged (Raster's latest image with FSO feed, though I expect 2007.x and 2008.x would be very similar) and I get these times with 'opkg update' (with two 'dead' feeds where I've not removed unused 'my-distribution.org' entries):

160 secs - usb0 up, dns pointing out usb0
40 secs - usb0 up, /etc/resolv.conf empty
5 secs - usb0 down with or without /etc/resolv.conf populated

So generally speaking, emptying resolv.conf leads to 25% the wait, bringing usb0 down leads to 3%. (oh, and of that 5 secs about 4 is opkg setting up before it tries to communicate - same for all scenarios - it fails each connection attempt faster than it can print the status to the screen with no route available)

The flipside is that if the default is to have nothing in /etc/resolv.conf when only usb0 is up, then there will be a stream of complaints and bug reports that USB networking is broken, etc. We can't require manual insertion of DNS each time a user plugs into a host computer through which they wish to route.

So the 'real' solution as I see it is to have resolv.conf populated 'correctly' for usb0, but bring usb0 down when no usb cable is present. (though I don't see a simple way to achieve that automatically ATM, only manually with a widget or icon) Without that, I don't see a way to "make both sides happy"... :(

Another possibility, addressing the specific opkg/assassin case, is to add a test to opkg_download() that tries to ping the default gateway, and dies if it's unreachable. Which seems sensible to me regardless. ;)

j

comment:6 in reply to: ↑ 5 Changed 9 years ago by marek

Replying to newkirk:

So the 'real' solution as I see it is to have resolv.conf populated 'correctly' for usb0, but bring usb0 down when no usb cable is present. (though I don't see a simple way to achieve that automatically ATM, only manually with a widget or icon) Without that, I don't see a way to "make both sides happy"... :(

What about using allow-hotplug in /etc/network/interfaces and let udev bring the interface up once it is plugged.

comment:7 Changed 9 years ago by newkirk

That sounds like a win, to me.

Eventually we'll want more complex behavior, both from the networking and from USB hotplug, but udev bringing up usb0 (with default DNS of opendns.org or similar) sounds like a simple fix for now.

Will there be problems if USB mass storage mode is enabled instead of networking?

comment:8 follow-up: ↓ 10 Changed 9 years ago by john_lee

  • HasPatchForReview unset

first attempt in om.dev 4b3c06b9c8a8a5099251843a06a9e9fa9ebae237

still need to get udev right and change auto to allow-hotplug. also need to remove the opendns from resolv.conf if usb unplugged.

comment:9 Changed 9 years ago by john_lee

  • Status changed from new to assigned
  • Owner changed from julian_chu to john_lee

comment:10 in reply to: ↑ 8 ; follow-up: ↓ 11 Changed 9 years ago by newkirk

Replying to john_lee:

first attempt in om.dev 4b3c06b9c8a8a5099251843a06a9e9fa9ebae237

still need to get udev right and change auto to allow-hotplug. also need to remove the opendns from resolv.conf if usb unplugged.

/IS/ udev capable of this given that the USB port is in g_ether mode, not usb host? I was unable to see any reaction whatsoever. I ended up writing support to trigger usb0 up/down off power supply sensing. http://jthinks.com/better-freerunner-networking

j

comment:11 in reply to: ↑ 10 Changed 9 years ago by john_lee

Replying to newkirk:

/IS/ udev capable of this given that the USB port is in g_ether mode, not usb host? I was unable to see any reaction whatsoever. I ended up writing support to trigger usb0 up/down off power supply sensing. http://jthinks.com/better-freerunner-networking

j

thanks for the info. I have downloaded netfix-j2 and will give it a go as soon as I find time.

comment:13 Changed 5 months ago by RoberMync

Que Es Cialis Super Active <a href=http://zol1.xyz/zoloft-buy-online.php>Zoloft Buy Online</a> Mega Hoodia Ou Acheter Du Cialis Forum <a href=http://kama1.xyz/cheap-kamagra-pills.php>Cheap Kamagra Pills</a> Dyes Amoxicillin Liquid Cancer Cheap Propecia University Of Kentucky <a href=http://kama1.xyz/kamagra-pill.php>Kamagra Pill</a> Kamagra 50mg Side Effects Ezonline Pharmacy <a href=http://kama1.xyz/cheap-generic-kamagra.php>Cheap Generic Kamagra</a> Valor Del Cialis Acheter Levitra Generique 20mg <a href=http://cytotec.ccrpdc.com/cytotec-usa.php>Cytotec Usa</a> Propecia Side Effects Sperm Prescription Amoxicillin Fish <a href=http://kama1.xyz/oral-jelly-kamagra.php>Oral Jelly Kamagra</a> Drug Without Script Online Meilleur Site Achat Cialis <a href=http://viag1.xyz/order-viagra-pills.php>Order Viagra Pills</a> Viagra 100mg Filmtabletten 12 Stuck Isotretinoin usa price quick shipping <a href=http://zol1.xyz/where-to-order-zoloft.php>Where To Order Zoloft</a> secure ordering isotretinoin with free shipping saturday delivery price Lioresal En Ligne 10mg <a href=http://viag1.xyz/viagra-online-cheap.php>Viagra Online Cheap</a> Non Generic Prednisone Online Cialis Pour Femme En Pharmacie <a href=http://cial5mg.xyz/cialis-online-pharmacy.php>Cialis Online Pharmacy</a> Elocon Mail Order Buy Prozac <a href=http://nolvadex.ccrpdc.com/order-nolvadex.php>Order Nolvadex</a> Products Dairy Amoxicillin For Sale Amoxicilina On Line Pills <a href=http://kama1.xyz/price-generic-kamagra.php>Price Generic Kamagra</a> Priligy Precio Espana Sporanox <a href=http://kama1.xyz/buy-kamagra-usa.php>Buy Kamagra Usa</a> Priligy Mutuabile Sky Pharmacy Review <a href=http://cytotec.ccrpdc.com/cheap-cytotec.php>Cheap Cytotec</a> Buy Xanical Online No Script Canadian Pharmacyviagra <a href=http://cial1.xyz/cialis-buy-online.php>Cialis Buy Online</a> Best Price Cialis 20mg Keflex And Amitiza Drug Interaction <a href=http://viag1.xyz/cheap-viagra-pills.php>Cheap Viagra Pills</a> Package Insert Amoxicillin Pre Medicate With Amoxicillin <a href=http://viag1.xyz/low-price-viagra.php>Low Price Viagra</a> No Perscription Drug Websites Actos Effect Of Food On Amoxicillin Absorption <a href=http://clomid.ccrpdc.com/clomid-online-cheap.php>Clomid Online Cheap</a> Muse Medicinale Himplasia <a href=http://viag1.xyz/sildenafil-dosage.php>Sildenafil Dosage</a> Propecia Online Non Prescription Levitra Usato In Farmacia <a href=http://viag1.xyz/viagra-free-trial.php>Viagra Free Trial</a> Is Kamagra Good Finpecia From India Online <a href=http://cial1.xyz/buy-cialis-online.php>Buy Cialis Online</a> Amoxicillin Dental Use For Pain Levitra Food <a href=http://zol1.xyz/buy-implicane.php>Buy Implicane</a> Provera Acheter Viagra Cialis Ligne <a href=http://cial1.xyz/cheap-cialis-tablets.php>Cheap Cialis Tablets</a> Malegra Dxt Review Keflex For Gum Infection <a href=http://xenical.ccrpdc.com/cheap-orlistat.php>Cheap Orlistat</a> Blaue Levitra Online Pharmaceutical Medications <a href=http://kamagra.ccrpdc.com/cheap-kamagra-tablets.php>Cheap Kamagra Tablets</a> Propecia Cheap No Prescription 1000 Mg Zithromax <a href=http://zol1.xyz/order-zoloft-online.php>Order Zoloft Online</a> Pfizer Buy Kamagra Macrobid 100mg <a href=http://viagra.ccrpdc.com/fast-delivery-viagra.php>Fast Delivery Viagra</a> Synthroid For Purchase Viagra Femenina Natural <a href=http://zol1.xyz/zoloft-implicane.php>Zoloft Implicane</a> Viagra Romania Levitra 5 Mg Contro L Impotenza <a href=http://cial5mg.xyz/cialis.php>Cialis</a> Composition Viagra 50 Cialis Overnight Delivery <a href=http://prozac.ccrpdc.com/prozac.php>Prozac</a> Canadian Non Prescription Pharmacy Priligy Uk Forum <a href=http://zol1.xyz/zoloft-buy-online.php>Zoloft Buy Online</a> Cialis 5mg Anwendung Where To Purchase Diflucan <a href=http://kama1.xyz/cheapest-kamagra.php>Cheapest Kamagra</a> Priligy 60 Mg Precio Kamagra Vendite Online <a href=http://cial5mg.xyz/online-cialis.php>Online Cialis</a> Levitra Originale Furosemide Tablets To Buy <a href=http://kama1.xyz/kamagra-jelly.php>Kamagra Jelly</a> Versand Viagra c. <a href=http://easymoneyfast-365.com>cash loans</a> Its level or by rates range affect debts you brokers the loans.Viagra Lagerung <a href=http://zol1.xyz/generic-zoloft-pricing.php>Generic Zoloft Pricing</a> Suche Viagra Ch On Line Viagra Super Active <a href=http://viag1.xyz/low-price-viagra.php>Low Price Viagra</a> Is It Safe To By Cialis Online Sildenafil GСЂВ nСЂВ rique <a href=http://kama1.xyz/kamagra-online-usa.php>Kamagra Online Usa</a> Amoxicillin Dosage For Sinus Chlymidia And Cephalexin <a href=http://cial1.xyz/cialis-order.php>Cialis Order</a> Order Zithromax Azithromycin how to purchase accutane <a href=http://cialis.ccrpdc.com/cialis-5mg.php>Cialis 5mg</a> Levitra Discount Priligy Comments <a href=http://zithromax.ccrpdc.com/buy-cheap-zithromax-site.php>Buy Cheap Zithromax Site</a> Amoxicillin Canine Costo Cialis O Viagra <a href=http://zol1.xyz/sertraline.php>Sertraline</a> Antibuse Cialis 36 Hrs <a href=http://kama1.xyz/kamagra-gel-online.php>Kamagra Gel Online</a> Drinking With Amoxicillin 500mg Cap Cheap 100mg Viagra Pills <a href=http://zol1.xyz/zoloft-generic.php>Zoloft Generic</a> Achat Viagra Paris Bentyl Cash Delivery For Sale <a href=http://cial1.xyz/buy-generic-cialis-online.php>Buy Generic Cialis Online</a> Cialis Generico Alta Qualita Amoxicillin Wiki <a href=http://nolvadex.ccrpdc.com/nolvadex-generic-name.php>Nolvadex Generic Name</a> Canadian Propecia Buy Amoxicillin Without Prescriptions <a href=http://kama1.xyz/generic-kamagra-cheap.php>Generic Kamagra Cheap</a> Buy Johnson And Johnson Propecia Levitra Lasting Time <a href=http://viag1.xyz/viagra-price.php>Viagra Price</a> Priligy Company Cialis 20 Vendita <a href=http://kama1.xyz/buy-cheap-kamagra-site.php>Buy Cheap Kamagra Site</a> order accutane online no prescription Tadora 40 Mg <a href=http://kama1.xyz/online-pharmacy-kamagra.php>Online Pharmacy Kamagra</a> Cialis E Testosterone

Note: See TracTickets for help on using tickets.