]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
initscripts: ensure cluster.conf exists
authorSage Weil <sage@newdream.net>
Mon, 2 Mar 2009 17:51:13 +0000 (09:51 -0800)
committerSage Weil <sage@newdream.net>
Mon, 2 Mar 2009 19:10:00 +0000 (11:10 -0800)
src/ceph-daemons
src/ceph_common.sh
src/cosd.conf
src/mkcephfs

index c0830ce57ca0c9724c89419fc6892ba9f80ad6c7..8d24cfca3086438cfcb3fd010d21047619afff4a 100755 (executable)
@@ -13,8 +13,6 @@ else
     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"
@@ -22,6 +20,9 @@ usage_exit() {
     exit
 }
 
+. $LIBDIR/ceph_common.sh
+
+
 stop_daemon() {
     name=$1
     daemon=$2
@@ -93,7 +94,6 @@ options="$options $1"
 shift
 done
 
-
 # build mon_addr_arg with all mon addrs
 n=0
 mon_addr_arg=""
@@ -115,9 +115,9 @@ for name in $what; do
     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
 
@@ -172,6 +172,11 @@ for name in $what; do
            $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
index 58e517b3f04835e340b9f275338d013d15d8b552..edbe1189e6ea72961472e98ea2e1b0eec313c3a0 100644 (file)
@@ -7,6 +7,13 @@ runtime_conf=$ETCDIR"/ceph.conf"
 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`
index 38c76de54adf9a03f401f596568e0675835ec58c..52fc1c9c03dfc9d684eac45494de7ba617f513a9 100644 (file)
@@ -5,6 +5,7 @@
 
 [mon]
 [mon0]
+       host = cosd0
        mon addr = 10.3.14.95:6789
        mon data = /home/sage/ceph/src/mondata/mon$num
 
@@ -32,4 +33,5 @@
        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
index bc4aaf84f7042ad2dbf1304f0b6d8fecdac4f455..2da42814d36e8dbe7bdd470af04beceb00737cf0 100755 (executable)
@@ -12,13 +12,14 @@ else
     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