[linux-cifs-client] Hardcoded cifs mount works but not automounter (autofs)

Leif Adelöw leif at adelow.com
Wed Aug 15 09:00:10 GMT 2007


On Tue, 2007-08-14 at 09:45 -0400, Jeff Layton wrote:
> On Tue, 14 Aug 2007 15:34:52 +0200
> Leif Adelöw <leif at adelow.com> wrote:
> 
> > Jeff,
> > Thanks for your effort/time:
> > I've tried that aswell, but it may be a good thing to reveal the result
> > of such a query (for the record):
> > 
> > <snippet from log-file>
> > Aug 14 15:28:18 pole automount[16083]: >> Mounting the DFS root for
> > domain not implemented yetNo ip address specified and hostname not found
> > </snippet from log-file>
> > 
> > The mensioned syntax works, however, in static auto.xcip file (below)
> > 
> > Thanks!
> > 
> > Best Regard
> > Leif Adelöw
> > ww.adelow.com
> >  
> > On Tue, 2007-08-14 at 08:14 -0400, Jeff Layton wrote:
> > > On Tue, 14 Aug 2007 12:41:05 +0200
> > > Leif Adelöw <leif at adelow.com> wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I have a problem with mount.cifs not beeing able to resolve NAMES (at
> > > > least I think I do). Any help is very much appreciated!
> > > > 
> > > > Using autofs with;
> > > > auto.master:  /xcip /etc/auto.dir/auto.xcip --timeout=60
> > > > auto.xcip:    Measurements -
> > > > fstype=cifs,username=yyy,password=xxx,file_mode=0644,dir_mode=0755,uid=leif,gid=users,iocharset=utf8  ://xcip/Measurements
> > > > 
> > > > works but not 
> > > > 
> > > > auto.master: /cifs program:/etc/auto.dir/auto.cifs --timeout=60
> > > > auto.cifs:
> > > > --<auto.cifs>
> > > > #!/bin/bash
> > > > # $Id$
> > > > # This file must be executable to work! chmod 755!
> > > > key="$1"
> > > > mountopts="-fstype=cifs,file_mode=0644,dir_mode=0755,uid=user,gid=users"
> > > > smbclientopts=""
> > > > for P in /bin /sbin /usr/bin /usr/sbin /usr/local/samba/bin/
> > > > do
> > > >         if [ -x $P/smbclient ]
> > > >         then
> > > >                 SMBCLIENT=$P/smbclient
> > > >                 break
> > > >         fi
> > > > done
> > > > [ -x $SMBCLIENT ] || exit 1
> > > > 
> > > >  mountopts=$mountopts",username=yyy,password=xxx"
> > > >  smbclientopts="-Uyyy%xxx"
> > > > 
> > > > $SMBCLIENT $smbclientopts -gL $key 2>/dev/null \
> > > >    | awk -v key="$key" -v opts="$mountopts" -F'|' -- '
> > > >         BEGIN   { ORS=""; first=1 }
> > > >         /Disk/  { if (first) { print opts; first=0 }; 
> > > >                   sub(/ /, "\\ ", $2); 
> > > >                   print " \\\n\t /" $2,"://" key "/" $2 }
> > > >         END     { if (!first) print "\n"; else exit 1 }
> > > >         '
> > > > 
> > > > --</auto.cifs>
> > > > 
> > > > $/etc/auto.dir/auto.cifs xcip
> > > > gives:
> > > > ----------------------------------------------------
> > > > -
> > > > fstype=cifs,file_mode=0644,dir_mode=0755,uid=user,gid=users,username=yyy,password=xxx\
> > > >          /D$ ://xcip/D$ \
> > > >          /mxccomtest ://xcip/mxccomtest \
> > > >          /NUUS2002\ (E) ://xcip/NUUS2002\ (E) \
> > > >          /temp ://xcip/temp \
> > > >          /ADMIN$ ://xcip/ADMIN$ \
> > > >          /Source ://xcip/Source \
> > > >          /C$ ://xcip/C$ \
> > > >          /Measurements ://xcip/Measurements
> > > 
> > > Maybe I'm wrong, but the ":" in the right hand side here looks strange.
> > > Maybe you need to alter your script so they don't appear? I think they
> > > should look something like:
> > > 
> > > 	/Measurements //xcip/Measurements
> > > 
> > 
> 
> This sounds more like an autofs problem than an issue with cifs. autofs
> generally just calls the mount program to do its bidding. If that
> syntax works when mounting manually, it may be that autofs is munging
> the command somehow. I'd suggest turning up autofs debugging and/or
> stracing the automounter to see if you can determine what it's doing
> wrong. You might also want to send this along to the autofs mailing
> list.
> 
> Jeff Moyer's people page has some good info on what to collect when
> tracking down autofs issues:
> 
> http://people.redhat.com/jmoyer/
> 

Jeff,
Thanks for your suggestions. Your probably right when pointing me
towards the autofs mailing lists given that file-map/statict approach
works fine. It was worth a shot however.

Thanks again

Best Regards

Leif Adelow
http://adelow.com 



More information about the linux-cifs-client mailing list