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 <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-02-10 17:34:53 +08:00
parent 4d505acdf3
commit 68ab318944

View File

@ -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."