From: 0x0916 Date: Sat, 1 Jul 2017 05:44:41 +0000 (+0800) Subject: start: send state to legacy lxc-monitord state server even if no state clients registered X-Git-Tag: lxc-2.1.0~76^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1661%2Fhead;p=thirdparty%2Flxc.git 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: 0x0916 --- diff --git a/src/lxc/start.c b/src/lxc/start.c index b7afc7bab..e1acc7c89 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -359,6 +359,7 @@ int lxc_set_state(const char *name, struct lxc_handler *handler, if (lxc_list_empty(&handler->state_clients)) { TRACE("no state clients registered"); process_unlock(); + lxc_monitor_send_state(name, state, handler->lxcpath); return 0; }