ETCDIR=/etc/ceph
fi
-CCONF="$BINDIR/cconf"
-conf=$ETCDIR"/startup.conf"
-cluster_conf=$ETCDIR"/cluster.conf"
-ARGS="-f"
-
-# get hostname, minus any domain
-hostname=`hostname | cut -d . -f 1`
-
. $LIBDIR/ceph_common.sh
usage_exit() {
command=$1
shift
-what="$@"
-if [[ $what = "" ]]; then
- # extract list of monitors, mdss, osds defined in startup.conf
- what=`$CCONF -c $conf -l mon | egrep -v '^mon$' ; \
- $CCONF -c $conf -l mds | egrep -v '^mds$' ; \
- $CCONF -c $conf -l osd | egrep -v '^osd$'`
-fi
+get_name_list "$@"
for name in $what; do
type=`echo $name | cut -c 1-3` # e.g. 'mon', if $item is 'mon1'
ssh=""
cmd=""
if [[ $host != "" ]]; then
- #echo host for $name is $host, i am $hostname
+ echo host for $name is $host, i am $hostname
if [[ $host != $hostname ]]; then
# skip, unless we're starting remote daemons too
if [[ $allhosts -eq 0 ]]; then
[[ $crun -eq 1 ]] && wrap="$BINDIR/crun"
get_conf_bool valgrind "$dovalgrind" "valgrind" $sections
- [[ $valgrind -eq 1]] && wrap="$wrap valgrind"
+ [[ $valgrind -eq 1 ]] && wrap="$wrap valgrind"
[[ $wrap != "" ]] && runmode="-f &"
+CCONF="$BINDIR/cconf"
+
+conf=$ETCDIR"/startup.conf"
+cluster_conf=$ETCDIR"/cluster.conf"
+
+hostname=`hostname | cut -d . -f 1`
+
+
+get_name_list() {
+ orig=$1
+
+ if [[ $orig = "" ]]; then
+ # extract list of monitors, mdss, osds defined in startup.conf
+ what=`$CCONF -c $conf -l mon | egrep -v '^mon$' ; \
+ $CCONF -c $conf -l mds | egrep -v '^mds$' ; \
+ $CCONF -c $conf -l osd | egrep -v '^osd$'`
+ return
+ fi
+
+ what=""
+ for f in "$orig"; do
+ case $f in
+ mon | osd | mds)
+ bit=`$CCONF -c $conf -l $f | egrep -v "^$f$"`
+ what="$what $bit"
+ ;;
+ *)
+ what="$what $f"
+ ;;
+ esac
+ done
+}
+
+
get_val() {
[ "$2" != "" ] && export $1=$2 || export $1=`$CCONF -c $conf "$3" "$4" "$5"`
}
ETCDIR=/etc/ceph
fi
-CCONF="$BINDIR/cconf"
-conf=$ETCDIR"/cluster.conf"
-
. $LIBDIR/ceph_common.sh
usage_exit() {
shift
done
-what=$*
-
-if [[ $what = "" ]]; then
- # extract list of monitors, mdss, osds defined in startup.conf
- what=`$CCONF -c $conf -l mon | egrep -v '^mon$' ; \
- $CCONF -c $conf -l mds | egrep -v '^mds$' ; \
- $CCONF -c $conf -l osd | egrep -v '^osd$'`
-fi
-
-# get hostname, minus any domain
-hostname=`hostname | cut -d . -f 1`
-
+get_name_list "$@"
# create the monmap if we're doing mon0
if [[ $what =~ "mon0" ]]; then