From: zhongtao Date: Wed, 13 Sep 2023 03:11:36 +0000 (+0800) Subject: containers in the FREEZING state also need to be unfreeze X-Git-Tag: v6.0.0~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c02367e59c389e69f7d4eb3cd4c0f5274c064a7d;p=thirdparty%2Flxc.git containers in the FREEZING state also need to be unfreeze Signed-off-by: zhongtao --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 9805b7a3f..ec6afbe24 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -544,7 +544,10 @@ static bool do_lxcapi_unfreeze(struct lxc_container *c) return false; s = lxc_getstate(c->name, c->config_path, 0); - if (s == FROZEN) { + // Prevent lxc from unexpectedly exiting when executing freeze, + // causing the container to be in the FREEZING state, + // making normal life cycle management impossible. + if (s == FROZEN || s == FREEZING) { ret = cgroup_unfreeze(c->name, c->config_path, -1); if (ret == -ENOCGROUP2) ret = lxc_unfreeze(c->lxc_conf, c->name, c->config_path);