2009-10-09 19:19:35 +00:00
|
|
|
|
|
|
|
# defaults
|
2009-12-02 00:18:23 +00:00
|
|
|
[ -z "$bindir" ] && bindir=$PWD # location of init-ceph
|
2009-10-09 19:19:35 +00:00
|
|
|
[ -z "$conf" ] && conf="$basedir/ceph.conf"
|
|
|
|
[ -z "$mnt" ] && mnt="/c"
|
2009-10-16 20:30:31 +00:00
|
|
|
[ -z "$monhost" ] && monhost="cosd0"
|
2009-10-09 19:19:35 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
mydir=`hostname`_`echo $0 | sed 's/\//_/g'`
|
|
|
|
|
2009-12-02 00:18:23 +00:00
|
|
|
client_mount()
|
2009-10-09 19:19:35 +00:00
|
|
|
{
|
|
|
|
/bin/mount -t ceph $monhost:/ $mnt
|
|
|
|
}
|
|
|
|
|
2009-12-02 00:18:23 +00:00
|
|
|
client_umount()
|
2009-10-09 19:19:35 +00:00
|
|
|
{
|
|
|
|
/bin/umount $mnt
|
|
|
|
# look for VFS complaints
|
|
|
|
if dmesg | tail -n 50 | grep -c "VFS: Busy inodes" ; then
|
|
|
|
echo "looks like we left inodes pinned"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2009-12-02 00:18:23 +00:00
|
|
|
ceph_start()
|
2009-10-09 19:19:35 +00:00
|
|
|
{
|
|
|
|
$bindir/init-ceph -c $conf start ${1}
|
|
|
|
}
|
|
|
|
|
2009-12-02 00:18:23 +00:00
|
|
|
ceph_stop()
|
2009-10-09 19:19:35 +00:00
|
|
|
{
|
|
|
|
$bindir/init-ceph -c $conf stop ${1}
|
|
|
|
}
|
|
|
|
|
2009-12-02 00:18:23 +00:00
|
|
|
ceph_restart()
|
2009-10-09 19:19:35 +00:00
|
|
|
{
|
|
|
|
$bindir/init-ceph -c $conf restart ${1}
|
|
|
|
}
|
|
|
|
|
2009-12-02 00:18:23 +00:00
|
|
|
ceph_command()
|
|
|
|
{
|
|
|
|
$bindir/ceph -c $conf $*
|
|
|
|
}
|
|
|
|
|
|
|
|
client_enter_mydir()
|
2009-10-09 19:19:35 +00:00
|
|
|
{
|
|
|
|
pushd .
|
|
|
|
test -d $mnt/$mydir && rm -r $mnt/$mydir
|
|
|
|
mkdir $mnt/$mydir
|
|
|
|
cd $mnt/$mydir
|
|
|
|
}
|
|
|
|
|
2009-12-02 00:18:23 +00:00
|
|
|
client_leave_mydir()
|
2009-10-09 19:19:35 +00:00
|
|
|
{
|
|
|
|
popd
|
|
|
|
}
|