Project

General

Profile

Bug #7489

`ceph-mon` is silent after non-zero exit status

Added by Alfredo Deza about 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Joao Eduardo Luis
Category:
Monitor
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

While attempting to add a monitor that already was in the cluster with a specific IP, instead of
reporting the actual error (or anything at all) the cli tool exits silently:

vagrant@node3:~$ sudo ceph-mon -i node3 --public-addr 192.168.1.102
vagrant@node3:~$ echo $?
1

History

#1 Updated by Samuel Just about 10 years ago

  • Priority changed from Normal to Urgent

#2 Updated by Samuel Just about 10 years ago

  • Category changed from ceph cli to Monitor

#3 Updated by Joao Eduardo Luis about 10 years ago

  • Assignee set to Joao Eduardo Luis

#4 Updated by Sage Weil about 10 years ago

  • Severity changed from 3 - minor to 2 - major

#5 Updated by Joao Eduardo Luis about 10 years ago

  • Status changed from New to 4

This only happens when the monitor is running as a daemon, which I would think is the expected result: all output is sent to the log instead of stdout/stderr.

We can find a way to "fix" this, but I'm inclined to see this as intended behavior and mark the ticket as "Rejected".

#6 Updated by Alfredo Deza about 10 years ago

Tools like 'ceph-mon' are used by other tools to abstract ceph management and those tools will almost always check exit codes of programs to determine an error condition.

So not only this tool is implying an error condition, it also does not give any output. If the expected behavior is to send output to logs, what is the expectation for
the automation tools? to parse the logs?

Logging can usually be configured to send messages to stderr as well as a file log, why is that not even an option here?

#7 Updated by Joao Eduardo Luis about 10 years ago

Here's the thing: as is, ceph-mon is being run as a daemon. That entails dissociating it from its running terminal, dupping stdout and stderr and closing the standard out and err file descriptors.

If you want to rely not only on the return value but also the output, you should run it in foreground, in this case by specifying the '-d' option, but then you'll have to handle program termination yourself.

#8 Updated by Sage Weil about 10 years ago

  • Status changed from 4 to Resolved

Also available in: Atom PDF