ETCDIR=/etc/ceph
fi
-. $LIBDIR/ceph_common.sh
-
usage_exit() {
echo "usage: $0 [options] {start|stop|restart} [mon|osd|mds]..."
printf "\t-c conffile.conf\n"
exit
}
+. $LIBDIR/ceph_common.sh
+
+
stop_daemon() {
name=$1
daemon=$2
shift
done
-
# build mon_addr_arg with all mon addrs
n=0
mon_addr_arg=""
type=`echo $name | cut -c 1-3` # e.g. 'mon', if $item is 'mon1'
num=`echo $name | cut -c 4-`
sections="$name $type global"
-
+echo $name
check_host || continue
-
+echo $name
get_conf pid_file "/var/run/ceph/$name.pid" "pid file" $sections
get_conf conf_file "$runtime_conf" "conf file" $sections
$0 $options stop $name
$0 $options start $name
;;
+
+ cleanlogs)
+ get_conf log_dir "/var/log/ceph" "log dir" $sections
+ do_cmd "for f in $log_dir/$name*; do rm `readlink $f` ; rm $f ; done"
+ ;;
*)
usage_exit
hostname=`hostname | cut -d . -f 1`
+# make sure cluster.conf exists
+if [ ! -e $conf ]; then
+ echo "$0: Cluster conf $conf not found"
+ usage_exit
+fi
+
+
check_host() {
# what host is this daemon assigned to?
host=`$CCONF -c $conf -s $name -s $type host`
[mon]
[mon0]
+ host = cosd0
mon addr = 10.3.14.95:6789
mon data = /home/sage/ceph/src/mondata/mon$num
osd data = devm/osd17
btrfs devs = /dev/disk/by-path/pci-0000:05:01.0-scsi-3:0:0:0
-[mds0]
\ No newline at end of file
+[mds0]
+ host = cosd0
\ No newline at end of file
ETCDIR=/etc/ceph
fi
-. $LIBDIR/ceph_common.sh
-
usage_exit() {
echo "usage: $0 [--allhosts] [-c conffile.conf] [--clobber_old_data] [--mkbtrfs]"
exit
}
+. $LIBDIR/ceph_common.sh
+
+
allhosts=0
clobber=""
mkbtrfs=0