OOo: when no Internet: very slow to start and does not open file
Hello :)
Normally I open OOo files from the file manager (Thunar) and it is inconveniently slow to open, especially the first file opened in the session. Just now I had no Internet connection and OOo would not open a file; the desktop (Xfce) session was partly frozen (Alt-tab worked to display tasks but would not switch to them; the Task List would not switch to any task windows; Alt+Ctrl+F1 worked). After rebooting from the Alt+Ctrl+F1 terminal (drastic but I've got an urgent documentation project and just wanted to progress it ASAP) I tried starting OOo from the command line without a document by running /usr/bin/soffice with no options or arguments. After ~1 minute it started the OOo GUI. Hoping to get some useful information, I closed the OOo GUI and ran netstat -a in a 1 second delayed loop, paused to get a baseline and then ran /usr/bin/soffice again. When the OOo GUI opened I killed the netstat loop. I was not able to identify anything related in the netstat output (perhaps more my ignorance than because it was not there). OOo is configured not to use Java, not to participate in the Improvement Program. The OOo Tools->Options->Internet settings are default -- mostly empty. I vaguely recall configuring OOo not to look for updates but cannot find a setting that confirms it. The document I was trying to open is a simple 33 kB accounts spreadsheet without any Internet links. Any ideas, including how to identify any Internet access that OOo is attempting? In case it matters, the OS is Slackware 13.0 32-bit and OOo is 3.1.1 installed from SlackBuilds. Best Charles |
Sounds like one or more apps want the hostname associated with the IP address the network interface is bound to, and that lookup fails because DNS requests can't get to the net. What IP address(es) does your machine have when the internet is not available? It might have only the local adress 127.0.0.1 or maybe some other default address. You can check with "ifconfig" or "ip addr show". Add these, with a host name, to /etc/hosts. Be sure "files" is one of the entries in the "hosts:" line of /etc/nsswitch.conf, too. This should give it some answer instantly instead of timing out asking the absent internet.
|
Quote:
The machine's IP is statically configured so is not affected by whether the NATting ADSL modem/router has a connection to the Internet or not. I checked what you suggested and they all looked OK but here's the output anyway in case I missed something Code:
root:~# ifconfig |
Based on the files you show, it should find your hostname from your IP address via the /etc/hosts file, as well as find the IP address from your hostname. So I guess we have to rule that out unless some program somewhere isn't following the configuration (e.g. uses its own methods instead of the resolver library). So maybe something else is happening.
I'd try this next. Run "tcpdump -nnl -i eth0 -s 1536 dst port 53" in a separate terminal window then try to run oOO and see if anything is doing any DNS queries, and what they are querying. If you see some query happening, you might try to do it while connected to the internet for a comparison and see if a meaningful answer comes back. If it's your host and/or IP address involved, then there is some rogue code doing the wrong thing. One option to deal with that is to run your own DNS cache/resolving server (e.g. BIND9) and configure it with whatever data you need (what is being queried). Change the /etc/resolv.conf file to use 127.0.0.1 as the nameserver. If it's a different host and/or IP address, put those in your /etc/hosts file (naming some other local IP address so you can track down what it's trying to do ... to verify it is not something sneaky that shouldn't be doing this). |
Thanks some more Skaperen :)
Quote:
For ease, I did it while connected to the Internet and your hunch is right; opening an OOo document results in DNS queries to resolve the local machine name: Code:
root:~# tcpdump -nnl -i eth0 -s 1536 dst port 53 Quote:
dnsmasq is used locally for DNS caching Code:
c:/etc$ cat dnsmasq.conf | grep -E -v '(^#)|(^$)' I turned on dnsmasq logging and opened an OOo file again. tcpdump showed similar activity, this time to all its configured DNS servers, as is normal when dnsmasq is initialising (it seems to try them all to determine which is quickest). dnsmasq uses /etc/hosts by default. This was confirmed by a line in /var/log/messages: Code:
Dec 15 21:19:26 CW8 dnsmasq[8059]: read /etc/hosts - 2 addresses |
Quote:
|
The Wikipedia article on dnsmasq says it is supposed to do as you need ... have clients "time out" immediately when the network connection is down. I don't know if this is a behaviour that depends on dnsmasq actually knowing the network is down or not (they mention modem links which would allow it to detect that easily). Maybe it isn't detecting that in your case because you are an ethernet hop from the (not connected) network.
I'm going to try running dnsmasq on my network in the next few days and see how it behaves. I might want to use it. |
Quote:
I did as you suggested, reconfigured dnsmasq accordingly and got the same result. So -- partly because I wasn't confident of having configured dnsmasq correctly and partly because the DNS server used was one of the two in resolv.conf rather than one of the other nine configured for dnsmasq -- I wondered if OOo was by-passing dnsmasq and did what I should have done in the first place (!), stopped dnsmasq and tried again -- with the same result. The question has now become "Why is OOo not resolving CW8 from /etc/hosts?". Maybe that's how OOo is programmed. Searching OpenOffice forum.org for DNS found some tantalisingly not-quite-similar problems but many were old. This was the closest reasonably recent one. With dnsmasq not running, dig and nslookup can't resolve CW8 (not surprisingly -- their man pages say they work with DNS servers?) but ping can ... Hoping for dnsmasq-sperts input I started a thread about configuring dnsmasq. |
It should resolve CW8 from /etc/hosts ... eventually. If that's what it was doing, then the goal is: eventually -> immediately. Even if the net is up, /etc/hosts should rule. That's its order in /etc/nsswitch.conf. You want files first (as do I), you should get files first. But seemingly it never resolves CW8 at all. Something is broken somewhere. I wonder if by some strange chance the fact that it is upper case causes this problem. It shouldn't since DNS is supposed to be case insensitive. But stranger things have been coded.
Yeah, expect dig and nslookup to fail when DNS fails ... they have a special job specific to DNS. Interesting that in the linked oOO forum thread, the first post is the opposite problem. Another wild thought along lines where I have had DNS-caused delays in the past (though not identical to this) is IPv6. Things to try: 1. Check that tcpdump for any "AAAA" queries. 2. Unconfigure IPv6 addresses from all interfaces. Resolver code could assume if an IPv6 address is up, it should also be queried. 3. Configure IPv6 addresses in the dnsmasq configuration and/or in /etc/hosts file (not sure if they need the [] around addresses there or not, but I think it should work with [] anyway). |
Thanks for all your help in this, Skaperen.
The problem is now solved, as you suggested, by configuring dnsmasq to serve local name resolution from the hosts file. Quote:
Quote:
|
Quote:
|
I find sendmail a nightmare to configure (I don't use it, anymore ... switched to Postfix) but I find BIND to be relatively simple (though the DNSSEC parts aren't so clear).
|
Quote:
|
All times are GMT -5. The time now is 08:40 AM. |