From: Kefu Chai Date: Fri, 10 Feb 2017 09:34:53 +0000 (+0800) Subject: init-ceph: print trailing n in "status" output X-Git-Tag: v12.0.1~453^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=68ab3189445e9353e75b485e148f5e9389212a82;p=ceph-ci.git init-ceph: print trailing n in "status" output the version command is handled by HelpHook, which does not print newline at the end of the returned JSON. so the output of "status" subcommand looks like: === osd.1 === osd.1: running {"version":"Development"}=== osd.2 === osd.2: not running. with this change, a newline is added to the end of version. also use the "daemon" subcommand to talk to the asok, let the "ceph" cli to figure out the asok path. Signed-off-by: Kefu Chai --- diff --git a/src/init-ceph.in b/src/init-ceph.in index 07f49c9458f..976e1b3253e 100755 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -462,7 +462,8 @@ for name in $what; do status) if daemon_is_running $name ceph-$type $id $pid_file; then printf "$name: running " - do_cmd "$BINDIR/ceph --admin-daemon $asok version 2>/dev/null" || echo unknown + do_cmd "$BINDIR/ceph daemon $name version 2>/dev/null" || printf unknown + printf "\n" elif [ -e "$pid_file" ]; then # daemon is dead, but pid file still exists echo "$name: dead."