]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: quote cmd params when display executing cmd 17057/head
authorJiaying Ren <jiaying.ren@umcloud.com>
Thu, 17 Aug 2017 04:11:32 +0000 (12:11 +0800)
committerJiaying Ren <jiaying.ren@umcloud.com>
Tue, 29 Aug 2017 07:08:43 +0000 (15:08 +0800)
vstart.sh will echo executed cmd to the stdout:

/root/jiaying/ceph/build/bin/radosgw -c /root/jiaying/ceph/build/ceph.conf --log-file=/root/jiaying/ceph/build/out/rgw.j.log --debug-ms=1 -n client.rgw --rgw_frontends=civetweb port=8000

As params contain whitespaces, pasting the above cmd into the shell didn't start rgw
on the port 8000. Now the vstart.sh output is like the following:

'/root/jiaying/ceph/build/bin/radosgw' '-c' '/root/jiaying/ceph/build/ceph.conf' '--log-file=/root/jiaying/ceph/build/out/rgw.j.log' '--debug-ms=1' '-n' 'client.rgw' '--rgw_frontends=civetweb port=8000'

We can paste above cmd to the shell to restart rgw, it's more convenient for debugging.

Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>
src/vstart.sh

index 82ec76bf94ee49b1bac36894a54815cbc14f5126..8d4d8ef369f2523edb162a938ef64d6e12ec275b 100755 (executable)
@@ -360,12 +360,12 @@ fi
 ARGS="-c $conf_fn"
 
 prunb() {
-    echo "$* &"
+    printf "'%s' " "$@"; echo '&'
     "$@" &
 }
 
 prun() {
-    echo "$*"
+    printf "'%s' " "$@"; echo
     "$@"
 }