LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-17-2012, 12:04 PM   #1
Ook
Member
 
Registered: Apr 2004
Location: Hell, Arizona
Distribution: Slackware 14.1
Posts: 349

Rep: Reputation: 28
Played with hosts, now certain console commands are very slow...


So I played with /etc/hosts, adding a few entries to see if it made a difference in browser performance and to disable certain ad banners, etc. When I did this, I found that if I were to open a console and try to start the midnight commander, it would just sit there for about 15 seconds before responding. During this 15 seconds, as far as I can tell nothing is happening - no cpu consumption, no network bandwith consumption, nothing. It is just sitting there. Fifteen seconds later, mc appears.

I restored my hosts file, reboot, problem still remains. Now I'm lost - I'm not sure why dinkering with the hosts file would cause this, and I'm even less sure why restoring it did not fix it. The only other time I saw this was when I had mounted a network share, and that share became unavailable while it was still mounted. In this case, there are no network shares mounted.

How do you troubleshoot something like this?

PS: This happens for all users including root.
Slackware 14 64 bit.

Last edited by Ook; 11-17-2012 at 12:09 PM.
 
Old 11-17-2012, 12:08 PM   #2
jefro
Guru
 
Registered: Mar 2008
Posts: 11,722

Rep: Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439
Nothing to do with hosts would be my guess. I have used hosts files on all sorts of OS's and never an issue like that. I get the standard one at a windows site.

Could it be that you didn't use or need to use ipv6? Some ipv6 issue.

Some other issue is at fault. It may be hard to find too. Try top command and maybe if you have or can install some system load monitor or other tools to graph the resources.

I am not too sure but there is an outside chance that some secure linux feature could be involved but I don't know how.
 
Old 11-17-2012, 12:11 PM   #3
Ook
Member
 
Registered: Apr 2004
Location: Hell, Arizona
Distribution: Slackware 14.1
Posts: 349

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by jefro View Post
Nothing to do with hosts would be my guess. I have used hosts files on all sorts of OS's and never an issue like that. I get the standard one at a windows site.

Could it be that you didn't use or need to use ipv6? Some ipv6 issue.

Some other issue is at fault. It may be hard to find too. Try top command and maybe if you have or can install some system load monitor or other tools to graph the resources.

I am not too sure but there is an outside chance that some secure linux feature could be involved but I don't know how.
Ran top and watched. Nothing changes, nothing is using any cpu when it is pausing. It may be coincidence, but it happened exactly when I dinkered with my hosts file.
 
Old 11-17-2012, 12:36 PM   #4
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,048

Rep: Reputation: 170Reputation: 170
I'm going to begin by stating that I'm taking a long shot stab at this, based neither on knowledge nor experience. There was a similar thread recently, unresolved:

https://www.linuxquestions.org/quest...in-4175436131/

and I'm curious as to whether your machine is having difficulty resolving your machine's hostname; iow, does your hosts file properly reflect your hostname, or domain...?

cheers,
 
Old 11-17-2012, 03:40 PM   #5
Ook
Member
 
Registered: Apr 2004
Location: Hell, Arizona
Distribution: Slackware 14.1
Posts: 349

Original Poster
Rep: Reputation: 28
SOLVED!

When I restored my hosts file, I left out:

127.0.0.1 ook.ook.org ook

I restored that line, and now everything works fine.

The question then becomes, why would not having this in the hosts file cause the problem? Midnight Commander must be trying to resolve the machine namae, and without this line it fails and times out. <shrug>....

Edit: I might mention that with this line in hosts, mc starts up in a fraction of a second. Poof, and it is there.

Last edited by Ook; 11-17-2012 at 03:41 PM.
 
Old 11-19-2012, 04:27 AM   #6
metageek
Member
 
Registered: Jun 2007
Location: manchester, uk
Distribution: Slackware
Posts: 118

Rep: Reputation: 24
Quote:
Originally Posted by Ook View Post
SOLVED!

When I restored my hosts file, I left out:

127.0.0.1 ook.ook.org ook

I restored that line, and now everything works fine.
Strange, I thought that one should never have that line, and use instead

127.0.0.1 localhost

have you tried this line too?
 
Old 11-19-2012, 07:02 AM   #7
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,077

Rep: Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787
Here's a thing. Slackware almost always includes notes and cautions in configuration files (if they're not already there from the developers); sort of lessons learned during a wasted youth kinds of things. /etc/hosts, straight from the "factory," has this:
Code:
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine.  It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#

# For loopbacking.
127.0.0.1               localhost
So that one has to be there and you should not monkey with it.

Your machine should have a name and an address. The name can be anything you like (the default on Slackware is "darkstar"); just something short and sweet (I name my servers fubar, snafu, pita and other pungent things). The address for a non-public server (not an Internet address) should be something like 192.168.x.y. The x is the subnet address from your router or switch and is, usually but not always, 1. The y is an address you pick, greater than 1 and less than 100, just so it's unique on your network (consisting of one or more Ethernet devices -- computers, printers, etc.)

Why 1? Because 1 is usually the gateway address of your router (a lot of them default to 192.168.1.1. Why < 100? Because DHCP starts at 100 by default and you can use a fixed IP address for your machine less that 100 and it won't interfere with DHCP.

Remember, we're talking about Slackware here; some other distribution might do things differently (and who cares what some other distribution fiddles around with).

Do you have a router? Probably you do -- many of the "modems" you get from your service provider nowadays are a combination modem/router (so you can't conveniently run a web site).

So, what does an /etc/hosts file look like? Like this:
Code:
#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.  Just add the names, addresses
#               and any aliases to this file...
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine.  It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#

# For loopbacking.
127.0.0.1               localhost
# Local servers
192.168.1.10            fubar.com fubar
192.168.1.15            InkJet
192.168.1.20            snafu.com snafu
192.168.1.30            pita.com pita
# Public servers
75.126.162.205          www.linuxquestions.org  linuxquestions.org

# End of hosts.
In the above there are three local servers, fubar.com, snafu.com and pita.com. There is one Ethernet printer, InkJet. This is one external server, linuxquestions.org.

Defining an external server as above means that you avoid hitting a DNS server; /etc/hosts is the first place "looked at" to find an address and, if an address is not found in /etc/hosts, the next places looked at is a DNS server, either BIND (if you're running it) or DNS server addresses in /etc/resolv.conf; e.g.,
Code:
cat /etc/resolv.conf
search com
nameserver 8.8.8.8
nameserver 8.8.4.4
Those two -- you only need two -- are Google's public DNS servers addresses. You're free to use those or ISP-provided addresses (these are just an example). If the first one is not available, the second will be looked at and it will take some time for the look up to fail before that switch happens (by then you'll be frustrated) so make sure you've got good DNS server addresses in /etc/resolv.conf.

Now, the trick is that all your local servers are listed in /etc/hosts (and the file is identical on all the servers). The IP address is first, followed by the name and domain of the server; e.g., fubar.com, followed by an alias (fubar). The alias means that your can, say, connect from fubar to snafu with SSH like this:
Code:
ssh snaf
You don't have to type the domain name. Not really a big deal, just a convenience.

Your host name is found in /etc/HOSTNAME; e.g.,
Code:
cat /etc/HOSTNAME
fubar.com
That's pretty much it. Simple and elegant.

Hope this helps some.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Most commonly used console commands punchy71 Linux - Newbie 1 12-14-2011 09:06 AM
List of Hosts in fedora DS Console??? ajeetraina Linux - Server 0 02-11-2008 11:40 PM
remote ssh commands on multiple hosts evilchild Linux - Software 6 08-12-2004 10:48 PM
Adding shell commands to hosts.deny and hosts.allow ridertech Linux - Security 3 12-29-2003 03:52 PM
Console Commands. Madmanator Linux - General 1 01-24-2002 02:10 PM


All times are GMT -5. The time now is 10:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration