From owner-freebsd-questions@FreeBSD.ORG Tue Apr 12 04:37:21 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C67116A4CE for ; Tue, 12 Apr 2005 04:37:21 +0000 (GMT) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88D3343D3F for ; Tue, 12 Apr 2005 04:37:19 +0000 (GMT) (envelope-from mail@iaindooley.com) Received: from [10.0.1.3] (c220-237-12-31.randw1.nsw.optusnet.com.au [220.237.12.31]) (authenticated bits=0)j3C4bG8I012220; Tue, 12 Apr 2005 14:37:17 +1000 Message-ID: <425BDEDB.2090801@iaindooley.com> Date: Tue, 12 Apr 2005 14:44:43 +0000 From: Iain Dooley User-Agent: Mozilla Thunderbird 0.7.2 (X11/20041107) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Hexren , freebsd-questions@freebsd.org References: <20050411000839.6683716A50A@hub.freebsd.org> <425A5242.9060502@iaindooley.com> <911455402.20050411091900@hexren.net> In-Reply-To: <911455402.20050411091900@hexren.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Loading Samba Shares at Startup X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2005 04:37:21 -0000 Hexren wrote: >>hi there, not really sure if this is appropriate for this list, or if i should be sending it to the samba lists. i'll try here first. > > >>i have a samba server which serves a few windows machines, and i also use it via sharity-light from my freebsd machine running 4.10 RELEASE. i have a script that loads my shares, and i put it in my >>rc.d folder (i've taken out the user and password info): > > >>#!/bin/sh >>/usr/local/sbin/shlight //cessna/http /usr/home/iain/development/http/ -U * -u * -g wheel -f 775 -d 775 -P * >>/usr/local/sbin/shlight //cessna/http_inertia /usr/home/iain/development/http_inertia/ -U * -u * -g wheel -f 775 -d 775 -P * >>/usr/local/sbin/shlight //cessna/music /usr/home/iain/music -U * -u * -g wheel -f 775 -d 775 -P * >>/usr/local/sbin/shlight //cessna/dools /usr/home/iain/dools_network -U * -u * -g wheel -f 775 -d 775 -P * > > >>it runs fine when i start up freebsd, but when i login, i don't have access to the shares. so i put the call to the script inside my .tcshrc file, but this means that, even if i login remotely, and >>every time i start a new konsole session or scp something, this script runs. > > >>does anyone have any clues as to why it wouldn't have access to the shares after running this script from inside rc.d? i really only want it to run when the machine starts up, not every time i >>login. > > >>cheers > > >>iain > > > > --------------------------------------------- > > I dont really know that programm, but guesing I would say the script > runs at some time where some condition it needs is not fullfilled like > maybe before networking is up. Maybe you should have the read up of > the rc.d starting proccess that I need ;) > > Or you just leave it in you .tcshrc file and work with a lock file. > Meaning when you run that script you do something like " > if ![ -x ~/.smblock ]; then > touch ~/.smblock > (insert rest of your script)" > okay, thanks for that idea. just for the purpose of closing the issue online, i ended up with a file called 'load_shares.sh': if ! [ -f /full/path/to/home/.smblock ]; then touch /full/path/to/home/.smblock shlight.sh #this is my script that uses sharity light to mount samba shares fi and put a call to load_shares.sh in .tcshrc (i like to avoid actually scripting for any shell other than sh). i then created a script called 'turnoff.sh': if [ -f /full/path/to/home/.smblock ]; then rm -rf /full/path/to/home/.smblock fi sudo shutdown -h now so long as i use turnoff.sh to shutdown my machine every time, my samba shares will be loaded the first time i login, but not reloaded unless i have actually shutdown the machine. thanks for your help iain