Unverified Commit 27c08a00 by 0x0916 Committed by Stéphane Graber

start: send state to legacy lxc-monitord state server even if no state clients registered

This pr https://github.com/lxc/lxc/pull/1618 kill lxc-monitord, for backwards compatibility, we also send state to legacy lxc-monitord state server in function `lxc_set_state`. we should also send state if there is no state clients registered, otherwise `lxc-monitor` client will not get state change event if container changed state to `STARTING` or `RUNNING`. Signed-off-by: 's avatar0x0916 <w@laoqinren.net>
parent 80fe6046
...@@ -345,6 +345,7 @@ int lxc_set_state(const char *name, struct lxc_handler *handler, ...@@ -345,6 +345,7 @@ int lxc_set_state(const char *name, struct lxc_handler *handler,
if (lxc_list_empty(&handler->state_clients)) { if (lxc_list_empty(&handler->state_clients)) {
TRACE("no state clients registered"); TRACE("no state clients registered");
process_unlock(); process_unlock();
lxc_monitor_send_state(name, state, handler->lxcpath);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment