]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: send state to legacy lxc-monitord state server even if no state clients registered 1661/head
author0x0916 <w@laoqinren.net>
Sat, 1 Jul 2017 05:44:41 +0000 (13:44 +0800)
committer0x0916 <w@laoqinren.net>
Sat, 1 Jul 2017 10:07:02 +0000 (18:07 +0800)
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 <w@laoqinren.net>
src/lxc/start.c

index b7afc7babef636e2b0c6868c42d377c3773c164a..e1acc7c89bfa1bcf63df554d9275abdd9a4ec98a 100644 (file)
@@ -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;
        }