View previous topic :: View next topic |
Author |
Message |
timblech Tux's lil' helper
Joined: 28 Oct 2003 Posts: 89
|
Posted: Fri Nov 28, 2003 9:51 am Post subject: starting emacs takes forever |
|
|
hi all,
... i've got a strange problem with my emacs ...
when running it (even as root) it takes several minutes to start...
but this is only when the network connection is running. emacs starts normal if either the computer is connected to the internet or all network connections except the loopback device are disabled ...
any hints? ... thanks... |
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Fri Nov 28, 2003 10:04 am Post subject: |
|
|
These sorts of delays, especially when a network is involved, often come back to DNS resolution. Make sure you have an entry in your /etc/hosts that associates 127.0.0.1 with your host name as well as "localhost" (just list your hostname after localhost, e.g. '127.0.0.1 localhost myhostname').
Now, why would emacs be doing DNS lookups? Perhaps you're using emacs mail or news or something? |
|
Back to top |
|
|
timblech Tux's lil' helper
Joined: 28 Oct 2003 Posts: 89
|
Posted: Fri Nov 28, 2003 10:17 am Post subject: |
|
|
meowsqueak wrote: | These sorts of delays, especially when a network is involved, often come back to DNS resolution. Make sure you have an entry in your /etc/hosts that associates 127.0.0.1 with your host name as well as "localhost" (just list your hostname after localhost, e.g. '127.0.0.1 localhost myhostname').
Now, why would emacs be doing DNS lookups? Perhaps you're using emacs mail or news or something? |
the only entry in the /etc/hosts is:
127.0.0.1 localhost
i don't use emacs for any network service except cvs ... i'm really confused, why it would send a dns lookup ... |
|
Back to top |
|
|
RangerDude Guru
Joined: 19 Apr 2003 Posts: 301
|
Posted: Fri Nov 28, 2003 10:23 am Post subject: |
|
|
I've got the same thing on my notebook. Without network, emacs never starts. Maybe it does after a long time, I've never waited so long.
Also X takes about 15 sec at start looking something up if networks isn't there. The two thing gives me that windows spyware feeling when something want to use the internet without me asking me first. |
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Fri Nov 28, 2003 10:34 am Post subject: |
|
|
Well, if emacs is trying to match your hostname with an ip address, and you haven't specified it in /etc/hosts, then it's going to try DNS. If the network interface is down, this query will fail quickly. If the interface exists but no DNS servers are able to provide you with a resolution, you might get a long delay.
As for why emacs might try a DNS - lots of reasons:
- network-mode CVS
- email
- newsgroups
- local hostname lookup
- X tcp connections
- lots of other reasons depending on what you're loading into your ~/.emacs
I'm not 100% sure the problem is /etc/hosts - but try it and see. |
|
Back to top |
|
|
credmp Apprentice
Joined: 02 Jul 2002 Posts: 207 Location: Netherlands
|
Posted: Fri Nov 28, 2003 12:02 pm Post subject: |
|
|
You might want to run strace when starting emacs... it will show you what it hangs on:
Code: |
shell$ strace emacs
|
regards |
|
Back to top |
|
|
timblech Tux's lil' helper
Joined: 28 Oct 2003 Posts: 89
|
Posted: Fri Nov 28, 2003 3:26 pm Post subject: |
|
|
credmp wrote: | You might want to run strace when starting emacs... it will show you what it hangs on:
Code: |
shell$ strace emacs
|
regards |
i tried to strace emacs and it tries to connect to all nameservers from /etc/resolv.conf ... is it possible to set up the for the eth0 connection in the /etc/init.d/net file?
thnx... |
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Fri Nov 28, 2003 9:03 pm Post subject: |
|
|
That means it's trying to resolve a name to an IP - it's trying DNS resolution, as I mentioned right at the start. If it can't find it in /etc/hosts it moves on to /etc/resolv.conf. If we assume it's trying to find the IP address of your local host, then it's trying to look up 'myhostname' - Simply change your /etc/hosts file as I've already suggested and see if that helps.
Alternatively, there's a file somewhere in /etc that defines the DNS search order - can't remember which one it is - you might need to put hosts before dns if changing the hosts file doesn't help. |
|
Back to top |
|
|
RangerDude Guru
Joined: 19 Apr 2003 Posts: 301
|
Posted: Fri Nov 28, 2003 9:28 pm Post subject: |
|
|
How do we prevent emacs from resolving the hostname? What part of emacs is needing it. I run the default emacs just after a clean merge. |
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Fri Nov 28, 2003 9:36 pm Post subject: |
|
|
Don't know if you can - a lot of programs like to know what interface address they are running on - the quickest and easiest way to satisfy the request is to modify your /etc/hosts:
Code: | 127.0.0.1 localhost myhostname
192.168.xxx.xxx myhostname
... |
Then, when the network isn't up (which means 192.168.xxx.xxx isn't going to exist), emacs will look up the local name (myhostname) and resolve to 127.0.0.1 rather than querying the DNS system (which will time out eventually).
I'm probably not going to mention /etc/hosts again... |
|
Back to top |
|
|
timblech Tux's lil' helper
Joined: 28 Oct 2003 Posts: 89
|
Posted: Sat Nov 29, 2003 11:53 am Post subject: |
|
|
meowsqueak wrote: | Don't know if you can - a lot of programs like to know what interface address they are running on - the quickest and easiest way to satisfy the request is to modify your /etc/hosts:
Code: | 127.0.0.1 localhost myhostname
192.168.xxx.xxx myhostname
... |
Then, when the network isn't up (which means 192.168.xxx.xxx isn't going to exist), emacs will look up the local name (myhostname) and resolve to 127.0.0.1 rather than querying the DNS system (which will time out eventually).
I'm probably not going to mention /etc/hosts again... |
i added that to the /etc/hosts and it's working now ... thanks for your help... |
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Sat Nov 29, 2003 9:13 pm Post subject: |
|
|
Glad to be of assistance |
|
Back to top |
|
|
|