# Problems with autofs mounting with ypbind

## silvrhand

Interesting problem,

It was working with gentoo 1.1, I upgraded a new machine to gentoo1.2 and I can't get autofs to work:  It seems to start things but the automount daemon just dies or never starts without any errors..

I tried to remerge autofs to see if something was wrong but still no luck, it just seems automount bombs out.  I'm not really familiar with the startup scripts yet, so I'm struggling with this if someone could help out I would appreciate it.

Not sure why it's not working..

+ echo -e ' * Starting automounter...'

 * Starting automounter...

+ getmounts

+ '[' -e /usr/bin/ypcat ']'

+ read cmd timeout mnt rest

ypcat -k auto.master 2>/dev/null | wc -l

++ ypcat -k auto.master

++ wc -l

+ '[' 10 -gt 0 ']'

+ ypcat -k auto.master

+ read dir map options

echo "$map" | cut -c1

++ echo auto.n.sun4-4.1

++ cut -c1

+ '[' '!' -z /n.sun4-4.1 -a '!' -z auto.n.sun4-4.1 -a xa '!=' x- ']'

echo "$map" | sed -e 's/^auto_/auto./'

++ echo auto.n.sun4-4.1

++ sed -e 's/^auto_/auto./'

+ map=auto.n.sun4-4.1

+ echo

+ grep -- -t

echo "$options" | sed -e '

                  s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g

                  s/\(^\|[ \t]\)-/\1/g'

++ echo ''

++ sed -e '

                  s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g

                  s/\(^\|[ \t]\)-/\1/g'

+ options=

+ echo '/usr/sbin/automount  /n.sun4-4.1 yp auto.n.sun4-4.1  '

+ read dir map options

+ echo /n.sun4-4.1

+ grep -v -- --timeout

+ rest=yp auto.n.sun4-4.1

+ mnt=/n.sun4-4.1

+ timeout=

+ echo -n ' /n.sun4-4.1'

 /n.sun4-4.1echo $mnt | sed 's/\//./g'

++ echo /n.sun4-4.1

++ sed 's/\//./g'

+ pidfile=/var/run/autofs.n.sun4-4.1.pid

+ start-stop-daemon --start --pidfile /var/run/autofs.n.sun4-4.1.pid --quiet --exec /usr/sbin/automount -- /n.sun4-4.1 yp auto.n.sun4-4.1

The process id in /var/run/autofs.* are all screwy also, something is really borked hehe..

jstrange-linux run # cat autofs.n.sun4-4.1.pid 

/n.sun4-4.1 

jstrange-linux run # pwd

/var/run

jstrange-linux run #

----------

## silvrhand

Still can't get it to work.

Is anyone running the latest autofs and ypbind with the automount maps as yp maps?

I can't seem to figure out why it's not working.

----------

## silvrhand

Okay getting pissed now, any help would be GREATLY appreciated..  This makes 0 sense unless something is majorly broken.

new kernel - nope

stock kernel - nope

start automount by hand - nope

strace automount

jstrange-linux / # usr/sbin/automount /us yp auto.us rsize=8192,wsize=8192

jstrange-linux / # mkdir /us

jstrange-linux / # usr/sbin/automount /us yp auto.us rsize=8192,wsize=8192

jstrange-linux / # cd /us/jstrange

-bash: cd: /us/jstrange: No such file or directory

jstrange-linux / # ypcat passwd | grep jstrange

jstrange:A7WCPF8X/WRcQ:13364:12:John W Strange:/us/jstrange:/bin/sh

jstrange-linux / # ypcat -k auto.us | grep jstrange

jstrange mixer:/vol/vol0/dis/&

jstrange-linux / # ypcat passwd | grep jstrange

jstrange:A7WCPF8X/WRcQ:13364:12:John W Strange:/us/jstrange:/bin/sh

Here is the strace:

jstrange-linux / # strace usr/sbin/automount /us yp auto.us rsize=8192,wsize=8192

execve("usr/sbin/automount", ["usr/sbin/automount", "/us", "yp", "auto.us", "rsize=8192,wsize=8192"], [/* 36 vars */]) = 0

brk(0)                                  = 0x804d3a8

old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000

open("/etc/ld.so.preload", O_RDONLY)    = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0

close(3)                                = 0

open("/etc/ld.so.cache", O_RDONLY)      = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=50654, ...}) = 0

old_mmap(NULL, 50654, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40017000

close(3)                                = 0

open("/lib/libdl.so.2", O_RDONLY)       = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\234\34"..., 1024) = 1024

fstat64(3, {st_mode=S_IFREG|0755, st_size=14490, ...}) = 0

old_mmap(NULL, 12396, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40024000

mprotect(0x40026000, 4204, PROT_NONE)   = 0

old_mmap(0x40026000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x40026000

close(3)                                = 0

open("/lib/libc.so.6", O_RDONLY)        = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\250\224"..., 1024) = 1024

fstat64(3, {st_mode=S_IFREG|0755, st_size=1426068, ...}) = 0

old_mmap(NULL, 1242144, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40028000

mprotect(0x4014d000, 42016, PROT_NONE)  = 0

old_mmap(0x4014d000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x124000) = 0x4014d000

old_mmap(0x40154000, 13344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40154000

close(3)                                = 0

munmap(0x40017000, 50654)               = 0

geteuid32()                             = 0

chdir("/")                              = 0

fork()                                  = 7129

--- SIGCHLD (Child exited) ---

_exit(0)                                = ?

----------

## cawhitepdx

But I did have to change one thing in the /etc/init.d/autofs script.  I added a "after ypbind" in the depend section.  Otherwise only some of my maps would get bound at startup.  Things would work just fine if I stop/started autofs after the system was fully booted though.

A few things:

Did you remember to compile in autofs support into your kernel? I am using the v4 stuff.

If you compiled the automounter support as a module, is it loaded?

Can you ypcat the auto.master map?

Does NFS otherwise work if you make connections manually and not through the automounter?

thx,

--chad

----------

## silvrhand

autofs has been compiled in 2.4.19-r7, 2.5.27, 2.4.18, both normal and ehanced v4 versions, and still no luck.

ypbind is up and running, I can ypcat -k auto.master, it actually sees them and starts the automount daemon but it just exits with no error message..

munmap(0x40017000, 50654) = 0

geteuid32() = 0

chdir("/") = 0

fork() = 7129

--- SIGCHLD (Child exited) ---

_exit(0) = ?

Yes I can manually mount the directory across NFS with no problems.

 *cawhitepdx wrote:*   

> But I did have to change one thing in the /etc/init.d/autofs script.  I added a "after ypbind" in the depend section.  Otherwise only some of my maps would get bound at startup.  Things would work just fine if I stop/started autofs after the system was fully booted though.
> 
> A few things:
> 
> Did you remember to compile in autofs support into your kernel? I am using the v4 stuff.
> ...

 

----------

## cawhitepdx

Thats pretty strange.  I didn't have any trouble getting it to work but my current nfs server is also linux (not Gentoo though.)  What OS is your NFS server?  I seem to remember having a similar problem a while ago when I was attaching to an HPUX nfs server as automount seems to use a different nfsver by default from mount.  I think it was that automount defaulted to nfsv3 while normal mount defaults to nfsv2 and the Linux kernel at that point at least wasn't entirely compatible with HP's nfsv3.  Just for grins you might try manually starting automount and adding a nfsver=2 after your rsize and wsize options.  Or if it still doesn't work try nfsver=3 as I might be remembering wrong  :Smile: 

I was going to have you look in your nsswitch.conf as that would be the usual Solaris answer but my system has "files" in the automounter line and it is working, so that must not be used in Gentoo..

Could you run the strace for starting automount with a -f so I can see what that last fork() is doing before the process exits?

thx,

--chd

[/quote]

----------

## hifi

Hi!

I've got the same problems, i've got this in my logs, maybe someone can help us, to find yperr_string    :Sad: 

Jul 27 12:13:09 pc213.sci.graz automount[21496]: cannot open lookup module yp (/usr/lib/autofs//lookup_yp.so: undefined symbol: yperr_string)

cu Robert

----------

## cawhitepdx

Did you guys forget to emerge yp-tools as well as ypbind?

Mine works, I have ypbind 1.11-r1 and yp-tools 2.7.

thx,

--chd

----------

## hifi

 *cawhitepdx wrote:*   

> Did you guys forget to emerge yp-tools as well as ypbind?
> 
> Mine works, I have ypbind 1.11-r1 and yp-tools 2.7.
> 
> thx,
> ...

 

No!

But it seems to be in autofs 

i replaced some lines in the code of lookup_yp.c 

So that there isn't any yperr_string(int ) called, and it worked . . .

cu robert

----------

## silvrhand

The NFS server is a Netapp F840, we have about 10 of them here with 0 problems.  This problem only came up after I installed the 1.3 CD on my new machine.

jstrange-linux autofs # strace -f /usr/sbin/automount /us yp auto.us rsize=8192,nfsver=2  2>/tmp/log

jstrange-linux autofs # cat /tmp/log 

execve("/usr/sbin/automount", ["/usr/sbin/automount", "/us", "yp", "auto.us", "rsize=8192,nfsver=2"], [/* 36 vars */]) = 0

brk(0)                                  = 0x804d3a8

old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000

open("/etc/ld.so.preload", O_RDONLY)    = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0

close(3)                                = 0

open("/etc/ld.so.cache", O_RDONLY)      = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=51260, ...}) = 0

old_mmap(NULL, 51260, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40017000

close(3)                                = 0

open("/lib/libdl.so.2", O_RDONLY)       = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\234\34"..., 1024) = 1024

fstat64(3, {st_mode=S_IFREG|0755, st_size=14490, ...}) = 0

old_mmap(NULL, 12396, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40024000

mprotect(0x40026000, 4204, PROT_NONE)   = 0

old_mmap(0x40026000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x40026000

close(3)                                = 0

open("/lib/libc.so.6", O_RDONLY)        = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\250\224"..., 1024) = 1024

fstat64(3, {st_mode=S_IFREG|0755, st_size=1426068, ...}) = 0

old_mmap(NULL, 1242144, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40028000

mprotect(0x4014d000, 42016, PROT_NONE)  = 0

old_mmap(0x4014d000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x124000) = 0x4014d000

old_mmap(0x40154000, 13344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40154000

close(3)                                = 0

munmap(0x40017000, 51260)               = 0

geteuid32()                             = 0

chdir("/")                              = 0

fork()                                  = 31622

[pid 31622] getpid()                    = 31622

[pid 31622] setpgid(0, 0 <unfinished ...>

[pid 31621] _exit(0)                    = ?

[pid 31622] <... setpgid resumed> )     = 0

[pid 31622] getpgrp()                   = 31622

[pid 31622] open("/dev/null", O_RDWR)   = 3

dup2(3, 0)                              = 0

dup2(3, 1)                              = 1

dup2(3, 2)                              = 2

close(3)                                = 0

brk(0)                                  = 0x804d3a8

brk(0x804d538)                          = 0x804d538

brk(0x804e000)                          = 0x804e000

brk(0x8051000)                          = 0x8051000

time([1027949844])                      = 1027949844

open("/etc/localtime", O_RDONLY)        = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=1267, ...}) = 0

old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000

read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0"..., 4096) = 1267

close(3)                                = 0

munmap(0x40017000, 4096)                = 0

getpid()                                = 31622

rt_sigaction(SIGPIPE, {0x40100994, [], 0x4000000}, {SIG_DFL},  :Cool:  = 0

socket(PF_UNIX, SOCK_DGRAM, 0)          = 3

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0

connect(3, {sin_family=AF_UNIX, path="/dev/log"}, 16) = -1 ENOENT (No such file or directory)

close(3)                                = 0

rt_sigaction(SIGPIPE, {SIG_DFL}, NULL,  :Cool:  = 0

time([1027949844])                      = 1027949844

getpid()                                = 31622

rt_sigaction(SIGPIPE, {0x40100994, [], 0x4000000}, {SIG_DFL},  :Cool:  = 0

socket(PF_UNIX, SOCK_DGRAM, 0)          = 3

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0

connect(3, {sin_family=AF_UNIX, path="/dev/log"}, 16) = -1 ENOENT (No such file or directory)

close(3)                                = 0

rt_sigaction(SIGPIPE, {SIG_DFL}, NULL,  :Cool:  = 0

time([1027949844])                      = 1027949844

getpid()                                = 31622

rt_sigaction(SIGPIPE, {0x40100994, [], 0x4000000}, {SIG_DFL},  :Cool:  = 0

socket(PF_UNIX, SOCK_DGRAM, 0)          = 3

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0

connect(3, {sin_family=AF_UNIX, path="/dev/log"}, 16) = -1 ENOENT (No such file or directory)

close(3)                                = 0

rt_sigaction(SIGPIPE, {SIG_DFL}, NULL,  :Cool:  = 0

open("/usr/lib/autofs//lookup_yp.so", O_RDONLY) = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \10\0\000"..., 1024) = 1024

fstat64(3, {st_mode=S_IFREG|0755, st_size=7023, ...}) = 0

old_mmap(NULL, 7688, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40017000

mprotect(0x40018000, 3592, PROT_NONE)   = 0

old_mmap(0x40018000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x40018000

close(3)                                = 0

munmap(0x40017000, 7688)                = 0

brk(0x8054000)                          = 0x8054000

time([1027949844])                      = 1027949844

getpid()                                = 31622

rt_sigaction(SIGPIPE, {0x40100994, [], 0x4000000}, {SIG_DFL},  :Cool:  = 0

socket(PF_UNIX, SOCK_DGRAM, 0)          = 3

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0

connect(3, {sin_family=AF_UNIX, path="/dev/log"}, 16) = -1 ENOENT (No such file or directory)

close(3)                                = 0

rt_sigaction(SIGPIPE, {SIG_DFL}, NULL,  :Cool:  = 0

_exit(1)                                = ?

 *cawhitepdx wrote:*   

> Thats pretty strange.  I didn't have any trouble getting it to work but my current nfs server is also linux (not Gentoo though.)  What OS is your NFS server?  I seem to remember having a similar problem a while ago when I was attaching to an HPUX nfs server as automount seems to use a different nfsver by default from mount.  I think it was that automount defaulted to nfsv3 while normal mount defaults to nfsv2 and the Linux kernel at that point at least wasn't entirely compatible with HP's nfsv3.  Just for grins you might try manually starting automount and adding a nfsver=2 after your rsize and wsize options.  Or if it still doesn't work try nfsver=3 as I might be remembering wrong 
> 
> I was going to have you look in your nsswitch.conf as that would be the usual Solaris answer but my system has "files" in the automounter line and it is working, so that must not be used in Gentoo..
> 
> Could you run the strace for starting automount with a -f so I can see what that last fork() is doing before the process exits?
> ...

 [/quote]

----------

## SamC

It's possible I've got things misconfigured, but I seem to be seeing the same thing.  The contents of the autofs pid file seems pretty strange:

```

sh-2.05a# cat /var/run/autofs.*.pid

/misc 

sh-2.05a# 

```

----------

## Uffe

I'm unfamiliar with ebuilds but here is what I notice (I ran into the missing yperr_string symbol too)...

yperr_string() is in libnsl (/lib/libnsl.so.1 -> libnsl-2.2.5.so, provided by glibc).  It looks like autofs' configure looks for yp_match() in libnsl but the test fails because the ebuild sets this:

```

export LIBS="-lldap -llber $LIBS"

```

and the yp_match conftest fails like this if openldap is not installed:

 *Quote:*   

> 
> 
> /usr/i686-pc-linux-gnu/bin/ld: cannot find -lldap
> 
> collect2: ld returned 1 exit status
> ...

 

or like this if openldap is installed:

 *Quote:*   

> 
> 
> /lib/libldap.so: undefined reference to `__dn_expand'
> 
> /lib/libldap.so: undefined reference to `__res_query'
> ...

 

Here is how I got lookup_yp.so linked with libnsl, feel free to correct me with the right way to do this with emerge (first three lines to force it to leave the build tree):

```

emerge unmerge autofs

source /etc/make.conf

export FEATURES="noclean"

emerge autofs

cd /var/tmp/portage/autofs-*/work/autofs-*

./configure --host=$CHOST

make

cp modules/lookup_yp.so /usr/lib/autofs/lookup_yp.so

```

----------

## brian33x51

Not sure if this is applicable, but I ended up adding these lines to my auto.master to get things to work:

/net    yp:auto.net

/misc   yp:auto.misc

What's strange is that I don't need to add these lines in my redhat 7.x and 8.0 boxes for them to pick up the yp maps automagically.

----------

