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

Jeff Layton jlayton at redhat.com
Tue Aug 14 12:14:43 GMT 2007


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

-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list