Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
programs freeze for 1-2 minutes [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
cristi1979
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 149

PostPosted: Sun Feb 04, 2007 8:51 am    Post subject: programs freeze for 1-2 minutes [SOLVED] Reply with quote

I have a very strange problem.

If I have set an IP address on eth0 and no cable pluged in my PC, when I try to start some programs, they freeze for 1-2 minutes, but after that period they start with no problem.

The programs with this behaviour are: cupsd, mc, ooffice2 and an other one from when kde starts(no idea wich one, but when I log in kde I have the same problem).
There is no activity after the programs are launched. It's like they are waiting for something and a timer expires.

If I remove /etc/resolv.conf the problem dissapears. The same if I put the interface down.

Here are the times the programs need to load with the net cable unpluged first and after with the cable pluged:

cristi@Gentoo-laptop ~ $ time mc
real 2m1.680s
user 0m0.048s
sys 0m0.021s
cristi@Gentoo-laptop ~ $ time mc
real 0m1.828s
user 0m0.045s
sys 0m0.021s


Gentoo-laptop cristi # time cupsd
real 1m0.095s
user 0m0.007s
sys 0m0.001s
Gentoo-laptop cristi # time cupsd
real 0m0.944s
user 0m0.004s
sys 0m0.001s

From what I saw, the only libraries in common for those programs are libdl and libc, both from glibc. I have this problem for more that 6 months now and I started to see it in FC6 also.

Any ideas?

Help?? :roll: :?: :?:


Last edited by cristi1979 on Sun Feb 04, 2007 3:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
JRV
Apprentice
Apprentice


Joined: 10 Jan 2004
Posts: 291

PostPosted: Sun Feb 04, 2007 11:46 am    Post subject: Re: programs freeze for 1-2 minutes Reply with quote

These programs are obviously trying to resolve something via DNS and then run into a timeout because your cable isn't plugged in. When the interface is down or there is no /etc/resolv.conf, there is no timeout, as the lack of connectivity/name resolution is noticed right away.

If you are interested in what the programs try to resolve or connect to, use either "strace -f" or a network sniffer such as Ethereal (now called Wireshark) to inspect the traffic caused by the programs.

You can also change the DNS resolver timeout value to something smaller in /etc/resolv.conf (look at "man resolv.conf" and search for the timeout option):

For example, to set the DNS timeout to 10 seconds and only try twice, add this line to your /etc/resolv.conf:
Code:
options timeout:10 attempts:2
Back to top
View user's profile Send private message
cristi1979
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 149

PostPosted: Sun Feb 04, 2007 3:04 pm    Post subject: Reply with quote

I have searched some more and the solution was to fix dnsdomain.
I have edited /etc/hosts to have for localhost the same as in /etc/conf.d/hostname.
Thank you for the answer.

... stupid linux with stupid problems...
I suffered for more than 6 months with this...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum