tc_command.sh - tinderbuild_cleanup

Joe Marcus Clarke marcus at marcuscom.com
Mon Apr 24 02:16:48 EDT 2006


On Mon, 2006-04-24 at 08:10 +0200, Oliver Lehmann wrote:
> Hi Joe, 
> 
> Joe Marcus Clarke writes: 
> 
> > This will find any mountpoint with the same source as the one configured
> > in the datastore for a given object.  Maybe the cleanupMounts function
> > could be rewritten to check to make sure that both the mount point and
> > the source (if it is defined) are what they should be.  Something like: 
> > 
> > if [ -n "${_dstloc}" ]; then
> >   mtpt=$(df | awk '$NF == mtpt { print $NF }' mtpt=${_dstloc})
> > fi 
> > 
> > if [ -n "${_srcloc}" ]; then
> >   mtpt_s=$(df | awk '$1 == mtpt { print $NF }' mtpt=${_srcloc})
> >   if [ "${mtpt}" != "${mtpt_s}" ]; then
> >     return 0
> >   fi
> > fi
> 
> If you go the way by fixing cleanupMounts, you can probably remove the 2nd
> stuff completly.
> If mtpt is set by using dtloc, it is the mtpt which has to be unmounted. No 
> verification against srcloc is needed. And if mtpt could not be set by using 
> dtloc - even if the srcloc thing would find sth. - it would be different 
> from the mtpt defined by using dtsloc (NULL). dstloc is always set, srcloc 
> not. 

I thought about this, too.  The reason I sent the code I did was to add
an extra verification step to make sure the the src and the mountpoint
match.  You're right, though, I think it could be dropped.

I'd like Ade to weigh in on this, though.

Joe

-- 
PGP Key : http://www.marcuscom.com/pgp.asc




More information about the tinderbox-list mailing list