autofs, automount, auto.master and mounting samba shares

First I added a symbolic link to /etc/init.d/rc5.d/:

cd /etc/init.d/rc5.d sudo ln -s ../autofs S21autofs

Then I added to the /etc/auto.master the following line:

/media/automounts /etc/auto.smbmounts

Then I created the file auto.smbmounts with the following content: -fstype=smbfs,username=michael,password=## ://paula/michael

Then I created the mountpoint:

sudo mkdir /media/automounts/

Then I activated the autofs daemon:

sudo /etc/init.d/autofs start

Now whenever one tries to access the directory /media/automounts/, the autofs daemon will mount the smb share automatically and unmount after a certain period of inactivity.