LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-25-2010, 06:38 PM   #1
SciFi-Bob
Member
 
Registered: Aug 2008
Location: Denmark
Distribution: Ubuntu
Posts: 62

Rep: Reputation: 18
autofs hostname lookup failed: Name or service not known


I am banging my head against the wall on this one.

I am running a debian squeeze server, and have autofs 5.0.4 installed.

One of my scripts (autofs executable files) is trying to mount some of
my LAN hosts.

The host mount fine at start, but when unmounted automatically, it will not mount again. (At least unless I wait for 2-3 minutes).
The problem is, maybe, that I get these messages in the log:

add_host_addrs: hostname lookup failed: Name or service not known
mount(nfs): no hosts available
failed to mount {myshare}

If I wait a couple of minutes, the share is mounting fine, but that is not an option.

What could it be?

The mount command issued by my script is mounting just fine on the command line after all these error messages, but autofs seems to have a problem with it anyhow.

I have searched all over the web trying to get a reasonable explanation to any of these messages without luck.

I don't think that I can upgrade automount, since this is an embedded device (SheevaPlug), so what is my options?
 
Old 10-25-2010, 06:48 PM   #2
SciFi-Bob
Member
 
Registered: Aug 2008
Location: Denmark
Distribution: Ubuntu
Posts: 62

Original Poster
Rep: Reputation: 18
Just to fill some holes, one of the current mounts is like this:

mount -t nfs -o rw,udp,hard,intr nslu2:/mnt/disk2/shared /shared/nslu2

The mount point on the "faulty" server is "/shared", and the dir mounts fine on the command line, just not after a timeout umount in autofs.

The dir "/shared/nslu2" exists, by the way

The above line mounts fine when executed on the command line, just not automatically after a umount by autofs.
 
Old 10-26-2010, 07:38 PM   #3
SciFi-Bob
Member
 
Registered: Aug 2008
Location: Denmark
Distribution: Ubuntu
Posts: 62

Original Poster
Rep: Reputation: 18
Okay, I solved this one myself. It was because I was sloppy about the output of my executable map file.. :-)

For anyone experiencing the same problem, I'll recommend to read this before continuing.
It may not be relevant to all versions of autofs, but it certainly is good reading.

http://docs.sun.com/app/docs/doc/806...a8539g7?a=view

To cut it short, I did a PING in the executable file, that messed up the "option server" output that autofs wanted.
So guys, reading the manual sometimes help.

To make it VERY short for all those who don't know what I'm talking about:

An autofs executable map is supposed to put only two strings (or several pairs) out to std output.

Those are: mount options, and server mount point.
autofs takes care of the local mount point by reading auto.master and the key.

Example output:

-fstype=nfs,rw,hard,intr server.com:/share1

Be sure to pipe all other output from mkdir/ping/etc to /dev/null before exiting (with level 0 on success, 1 on error).
And, remember to check your executable file by calling it with the key name on the command line, to see what it returns. That is what I forgot.

Well, I feel kind of stupid, but at least I've learned something: autofs outputs confusing error messages, even in debug mode.. :-D
 
1 members found this post helpful.
  


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
Hostname lookup failure chandrait2004 Linux - Newbie 3 06-23-2011 03:23 PM
Internal Hostname Lookup divot_powell Linux - Networking 1 10-18-2009 02:15 PM
Lookup hostname from IP address Geneset Linux - Networking 5 08-26-2008 05:03 AM
cifs + autofs failed to lookup (program) UltraSoul Linux - Software 0 06-22-2008 09:53 AM
autofs service viral_Ahire Linux - Server 2 03-11-2008 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration