Subject: Re: Re: amd and smbfs
To: None <joel@carnat.net>
From: Hauke Fath <hf@spg.tu-darmstadt.de>
List: netbsd-users
Date: 04/28/2005 13:47:06
Am 28.04.2005 um 11:52 Uhr +0200 schrieb Joel CARNAT:
>  > The Amd 6.1 release candidate (available as snapshot, or from anoncvs,
>>  at www.am-utils.org) ) has an /etc/amd.conf variable 'normalize_slashes'
>>  that you set to 'no' to switch off path normalizing.
>>
>
>  OK, I have netbsd-3 with 6.1b5pre installed :)

That's too old. The change I mentioned has appeared in the amd tree 
maybe two weeks ago.

>  > With this feature, a map entry for an SMB mount looks like
>>
>>  smbmnt	-type:=program;rhost:=smbserver;rfs:=smbshare;fs:=/.smbshare \
>>          os==netbsdelf2;\
>>          mount:="/sbin/mount mount -r -t smbfs -o-N,-I${rhost}
>>  //${rhost}/${rfs} ${fs}";\
>>          unmount:="/sbin/umount umount ${fs}"
>>
>
>  as I understand map syntax, this makes the non-dynamic mount point
>//smbserver/smbshare mounted in /.smbshare, right ?

Yep. Amd calls the 'unmount' command when it times out the mount.

>  I still have two questions :
>-> I won't need the fstab anymore, right ?

Correct.

>-> is there a wildcard or variable to indicate the SMBshare ?

No.

>    I mean, I would like to "cd /mnt/smb/SMBhost_I_known/SMBshare_I_know"
>and it is automagically mounted (aka, not having n smbmnt lines like
>above). Mixing your example and /usr/share/examples/amd/net, I ended
>with :
>################################################################
>/defaults
>type:=host;rhost:=${key};fs:=${autodir}/${rhost}/${smbshare}
>*               host==${key};type:=program;\
>                         rfs:=${smbshare};\
>                         fs:=${autodir}/${key}/${smbshare};\
>                         mount:="/sbin/mount mount -t smbfs 
>-o-N,-I${rhost},-f=0644,-d=0755 //${host}/${rfs} ${fs}";\
>                         unmount:="/sbin/umount umount ${fs}"
>################################################################
>
>  As I expected, amd goes : Unknown sequence "${smbshare}"

You need to use ${key} for that instead of "${smbshare}" (which, you 
guessed it, is not defined), since it has the value that the wildcard 
currently matches. And, of course, the directory that the 'mount' 
command uses as mountpoint had better exist - but you could take care 
of that with a wrapper script.

You probably want to get a copy of Erez Zadok's "Linux NFS and 
Automounter Administration".  ;)

	hauke

-- 
/~\  The ASCII Ribbon Campaign                    Hauke Fath
\ /    No HTML/RTF in email	        Institut für Nachrichtentechnik
  X     No Word docs in email	                  TU Darmstadt
/ \  Respect for open standards              Ruf +49-6151-16-3281