[SOLVED] mounting shares on samba system

Dave S kubuntu at pusspaws.net
Sun Apr 9 09:07:39 UTC 2006


Hi all,

I finally worked a solution to mounting shares on the same system as samba is 
running.

No matter what i tried on bootup some shares were occasionally not mounted 
(because samba demons just starting ?). So I made a  init.d file and linked 
to it from the run levels ...


#!/bin/sh

# To keep kfloppy happy
ln -s /dev/fd0 /dev/fd0u1440

# To get round running samba server and access samba on same machine
# and to make the mounting process bombproof
smb_mount() {

declare -i i=0
until cat /etc/mtab | grep //127.0.0.1/$1 &> /dev/null ||  [ $i -ge 5 ]; do

    mount -t smbfs //127.0.0.1/$1 /mnt/samba/$1 -o 
credentials=/home/dave/.smbpw,uid=dave,gid=dave,fmask=$2,dmask=$3 > /dev/null
    sleep 1
    i=$i+1
done
}

smb_mount common 666 777 &
smb_mount windows 666 777 &
smb_mount archive 660 770 &

Also makes kfloppy work ;)

Dave

PS any comments about my dodgey code welcome, don't code enough to be good at 
it :)

Dave






More information about the kubuntu-users mailing list