Re: autofs/smbfs - delayed mounting?

Michael H. Warfield (
Tue, 1 Dec 1998 21:49:43 -0500 (EST)

Nicholas J. Leon enscribed thusly:
> On Tue, 1 Dec 1998, Michael H. Warfield wrote:

> # Something fishy here... Process 758 has gone zombie... I'm really
> # curious what the parent processes to 769 and 758 were... I'm also curious
> # to see what your automount map looked like.

> Ok, I'll warn 'ya, my setup is bizarre :)

Ok... Now some things are coming clearer...

You're using the mount.fstype hook in mount instead of the built-in
smbfs support. Ok... Noted...

> [/etc/autofs.conf]
> floppy -fstype=auto :/dev/fd0
> boot -fstype=ext2 :/dev/hda1
> zip -fstype=auto :/dev/sda4
> cd -fstype=auto :/dev/hdd
> cdr -fstype=auto :/dev/sr0
> madi -rw,soft,intr,rsize=8192,wsize=8192 madi:/
> pico -rw,soft,intr,rsize=8192,wsize=8192 pico:/
> tao -fstype=smb tao:/c
> nicadaemus -fstype=smb nicadaemus:/c

> # I see that there is no password (it would have appeared as an XXXXX
> # in the ps display). Is there a password on the share? If you run the
> # smbmount program (the binary - not any front end scripts such as mine)
> # manually, do you get prompted for a password?

> No passwords are used. And no, if I run stuff manually, I don't get
> prompted for a password.

> # Since you are using autofs, are you using my shell script
> # <> or another script for

> Another, a very simple one:

> [/sbin/mount.smb]
> #!/bin/sh

> CPATH=$1
> POINT=$2
> OPT=$3

> NEW="\\\\`echo $CPATH | cut -f1 -d:`"
> SHARE=`echo $CPATH | cut -f2 -d/`


> #echo smbmount $NEWSHARE -c "mount $POINT -u 0 -g 0"
> smbmount $NEWSHARE -c "mount $POINT -u 0 -g 0" &
> sleep 10
> killall -HUP smbmount

> ---

> I put the 'sleep && killall' because it ``fixed'' my problem (sending any
> signal to smbmount makes it exit and continue normally).

> This is hackish, very much so. But I was just testing for right now.

The fix will kill off your reconnect daemon and commit other random
acts of terrorism. That is a very bad idea. What if there was another
mount in progress at that moment? Mounts with smbmount can take significant
amounts of time for authentication handshaking...

> # I also see that the -N option (no password) is NOT present. That
> # makes me even more suspicious that smbmount is attempting to prompt for
> # a password and you are hung there waiting...

> I don't think so. If I run

> /sbin/mount.smb tao:/c /mnt1

> it works just fine. But anyhook, I just changed my script to use -N on
> smbmount and it didn't make any difference.

Hmmm... Then I strongly suspect that you are running into the
same problem I saw when I got my smbmount script going. It works fine
with no hanging when done manually or when stdout and stderr are redirected
to files. When left alone, and automount attempts to redirect the output
to syslog, smbmount hangs exactly as you have described.

Try this...

Take out the ugly sleep...killall hack and use this smbmount
command in the script instead:

smbmount $NEWSHARE -c "mount $POINT -u 0 -g 0" > /tmp/smbmount.$$.out 2> /tmp/smbmount.$$.err

If this works, you are running into the syslog problem that I'm
trying to track down...

WARNING!!! That command is for TESTING only and contains security
risks! Don't use it if anyone on your system can play silly buggers with

> G'day!
> -- n i c h o l a s j l e o n
> / elegance through simplicity /
> / good fortune through truth /
> / not all questions have answers /


 Michael H. Warfield    |  (770) 985-6132   |
  (The Mad Wizard)      |  (770) 925-8248   |
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at