HomeClusterLabs Projects

Fix: tools: crm_mon --daemonize should update when disconnected

Description

Fix: tools: crm_mon --daemonize should update when disconnected

With crm_mon --daemonize, currently the output will continue to show the
last known status after the cluster is stopped on the local node. This
commit causes it to write "Not connected to CIB" (and more specific
details) to the output file:

  • before the initial connection;
  • as soon as the CIB connection is destroyed; and
  • every time a reconnection attempt fails

External agents are notified via traps rather than via output, so we can
ignore them.

We register the new message formatter functions directly instead of via
crm_mon_register_messages(). The reason is that
crm_mon_register_messages() is used for messages specific to the curses
format, so that they can be registered from within crm_mon.c. The new
crm-mon-disconnected formatter isn't used with console output; it's not
really necessary, and it's more complicated to implement (attempts so
far led to display issues after connection loss).

In the future it might make sense to rename crm_mon_register_messages()
in crm_mon_curses.c and reuse that name in crm_mon.c.

Closes T15

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Nov 2 2022, 12:02 PM
Parents
rP249521e7cab5: Low: tools: Improve log messages in crm_mon.c
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task