[SOLVED] OOo: when no Internet: very slow to start and does not open file
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Last edited by catkin; 12-14-2009 at 05:02 AM.
Reason: Saner title
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.
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.
Thanks Skaperen
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
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).
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.
Nice technique, good to learn about it
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
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 1536 bytes
[nothing more until opening an OOo document when ...]
21:03:51.416688 IP 192.168.1.47.62312 > 218.248.240.180.53: 44135+ A? CW8.(none). (28)
21:03:51.465604 IP 192.168.1.47.2813 > 218.248.240.180.53: 46826+ A? CW8.(none). (28)
218.248.240.180 is one of the DNS servers configured locally.
Quote:
Originally Posted by Skaperen
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).
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
The question has become "Why does dnsmasq not resolve CW8 from /etc/hosts?"
Last edited by catkin; 12-21-2009 at 11:01 AM.
Reason: timeout as marked by EDIT
The question has become "Why does dnsmasq not resolve CW8 from /etc/hosts?"
I have not used dnsmasq, so I just briefly did an overview of the man page for it. The wording of a couple places suggests to me that even if an entry exists in /etc/hosts, it will do a DNS query anyway (going to the recursive server if it doesn't have such data in its cache already). It is more of a "shadow" feature to read /etc/hosts than it is a means to bypass the need to query DNS. Apparently it has to query DNS anyway just to see of there are alternate records like CNAME that change its behaviour. Read the man page and see if you can get anything else out of it that would apply to your situation. If there isn't a way to get it to do as your need to have done while not connected to the net, then you probably need a full DNS server like BIND. I've fudged DNS data for other hosts in BIND before, eliminating upstream DNS queries for those names.
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.
I have not used dnsmasq, so I just briefly did an overview of the man page for it. The wording of a couple places suggests to me that even if an entry exists in /etc/hosts, it will do a DNS query anyway (going to the recursive server if it doesn't have such data in its cache already). It is more of a "shadow" feature to read /etc/hosts than it is a means to bypass the need to query DNS. Apparently it has to query DNS anyway just to see of there are alternate records like CNAME that change its behaviour. Read the man page and see if you can get anything else out of it that would apply to your situation. If there isn't a way to get it to do as your need to have done while not connected to the net, then you probably need a full DNS server like BIND. I've fudged DNS data for other hosts in BIND before, eliminating upstream DNS queries for those names.
Thanks for researching it.
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 ...
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).
The problem is now solved, as you suggested, by configuring dnsmasq to serve local name resolution from the hosts file.
Quote:
Originally Posted by Skaperen
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.
It was and I broke it -- in dnsmasq.conf by configuring no-resolv which disabled resolv-file=/etc/resolv.dnsmasq.conf thus leaving dnsmasq with only the two DNS servers in resolv.conf. This only became obvious when I ran netconfig (to change CW8 to cw8) and incidentally removed all DNS servers but 127.0.0.1 from resolv.conf. After fixing the dnsmasq.conf error and re-testing, tcpdump did not show any DNS queries so I changed the hostname back to CW8 and tcpdump still did not show any DNS queries
Quote:
Originally Posted by Skaperen
Yeah, expect dig and nslookup to fail when DNS fails ... they have a special job specific to DNS.
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.
You might well; the more I find out about dnsmasq the more I like the thorough way it's put together and the mailing list contributors are well with-it -- insofar as I can understand the net-speak. dnsmasq is easy to configure too, compared to other networking software (sendmail! BIND!).
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).
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).
Now I have to confess that I haven't actually configured BIND in any but the most trivial ways and then rarely but I got the O'Reilly book when I was a new and keen UNIX sysadm; just reading it made my head spin NIS on Solaris 7 (fogotten the version but it was a "new, improved, more generalised" one) was another one I found very, er, challenging.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.