Slow start of Midnight Commander

mc/subshell integration is a frequent culprit; to verify, try:

alias mc="mc --nosubshell"

Actually editing /etc/hosts solved the problem for me.

My mc took 10 seconds to start due to the fact that during startup mc tries to resolve the local hostname to an IP address.

I added to /etc/hosts the following line (my hostname is FOO)

127.0.0.2 FOO.domain FOO

That instantly solved the problem.


It works for me now. I am using

GNU Midnight Commander 4.8.21

strace wait on long time

connect(3, {sa_family=AF_INET, sin_port=htons(6011),
  sin_addr=inet_addr("x.x.x.x")}, 16) = ? ERESTARTSYS
  (To be restarted if SA_RESTART is set)' 

I tried this:

# hostname

use this for /etc/hosts:

nameofhost=hostname

add this $nameofhost to the /etc/hosts on line starting with

127.0.0.1 localhost ... $nameofhost 

Cheers!

Tags:

Mc