]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
src/vstart.sh: Add --no-restart to vstart & add mkfs logs to osd.stdout 44887/head
authorJoseph Sawaya <josephsawaya938@gmail.com>
Thu, 3 Feb 2022 16:46:44 +0000 (11:46 -0500)
committerJoseph Sawaya <jsawaya@redhat.com>
Fri, 4 Feb 2022 21:07:35 +0000 (16:07 -0500)
The output of mkfs wasn't also being included in the OSD's log before this which
can make it more difficult to debug issues with mkfs.

ceph-run restarting every 5 seconds can make it difficult to read the osd's stdout.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
src/ceph-run
src/vstart.sh

index afc3d1a51358cdc0773fd69dfe08c96668a8ce6d..764101c564f84d639a3321200a47773b8570cd14 100755 (executable)
@@ -1,12 +1,18 @@
 #!/bin/sh
 
 sleep=5
+no_restart=0
+
+if [ $1 == "--no-restart" ]; then
+    no_restart=1
+    shift
+fi
 
 while [ true ]; do
     "$@"
     exit_code=$?
     
-    if [ $exit_code -gt 128 ]; then
+    if [ $exit_code -gt 128 ] && [ $no_restart -eq 0 ]; then
        case $(($exit_code-128)) in
            3 | 4 | 5 | 6 | 8 | 11)
                ;;
index 2573b364b9a94a9da22f331466ecf1c585c45aa8..5a58135278de7c50799b83bb8b538eeba7767bc5 100755 (executable)
@@ -150,6 +150,7 @@ short=0
 ec=0
 cephadm=0
 parallel=true
+restart=1
 hitset=""
 overwrite_conf=0
 cephx=1 #turn cephx on by default
@@ -244,6 +245,7 @@ options:
        --inc-osd: append some more osds into existing vcluster
        --cephadm: enable cephadm orchestrator with ~/.ssh/id_rsa[.pub]
        --no-parallel: dont start all OSDs in parallel
+       --no-restart: dont restart process when using ceph-run
        --jaeger: use jaegertracing for tracing
        --seastore-devs: comma-separated list of blockdevs to use for seastore
        --seastore-secondary-des: comma-separated list of secondary blockdevs to use for seastore
@@ -352,6 +354,9 @@ case $1 in
     --no-parallel)
         parallel=false
         ;;
+    --no-restart)
+        restart=0
+        ;;
     --valgrind)
         [ -z "$2" ] && usage_exit
         valgrind=$2
@@ -575,10 +580,15 @@ run() {
     else
         if [ "$nodaemon" -eq 0 ]; then
             prun "$@"
-        elif [ "$redirect" -eq 0 ]; then
-            prunb ${CEPH_ROOT}/src/ceph-run "$@" -f
         else
-            ( prunb ${CEPH_ROOT}/src/ceph-run "$@" -f ) >$CEPH_OUT_DIR/$type.$num.stdout 2>&1
+            if [ "$restart" -eq 0 ]; then
+                set -- '--no-restart' "$@"
+            fi
+            if [ "$redirect" -eq 0 ]; then
+                prunb ${CEPH_ROOT}/src/ceph-run "$@" -f
+            else
+                ( prunb ${CEPH_ROOT}/src/ceph-run "$@" -f ) >$CEPH_OUT_DIR/$type.$num.stdout 2>&1
+            fi
         fi
     fi
 }
@@ -991,7 +1001,8 @@ EOF
             echo "{\"cephx_secret\": \"$OSD_SECRET\"}" > $CEPH_DEV_DIR/osd$osd/new.json
             ceph_adm osd new $uuid -i $CEPH_DEV_DIR/osd$osd/new.json
             rm $CEPH_DEV_DIR/osd$osd/new.json
-            prun $SUDO $CEPH_BIN/$ceph_osd $extra_osd_args -i $osd $ARGS --mkfs --key $OSD_SECRET --osd-uuid $uuid $extra_seastar_args
+            prun $SUDO $CEPH_BIN/$ceph_osd $extra_osd_args -i $osd $ARGS --mkfs --key $OSD_SECRET --osd-uuid $uuid $extra_seastar_args \
+                2>&1 | tee $CEPH_OUT_DIR/osd-mkfs.$osd.log
 
             local key_fn=$CEPH_DEV_DIR/osd$osd/keyring
             cat > $key_fn<<EOF