Bug #7489
closed
`ceph-mon` is silent after non-zero exit status
Added by Alfredo Deza about 10 years ago.
Updated about 10 years ago.
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
- Priority changed from Normal to Urgent
- Category changed from ceph cli to Monitor
- Assignee set to Joao Eduardo Luis
- Severity changed from 3 - minor to 2 - major
- 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".
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?
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.
- Status changed from 4 to Resolved
Also available in: Atom
PDF