From: Christian Brauner Date: Sun, 27 Nov 2016 05:01:36 +0000 (+0100) Subject: lxccontainer: log failure to send sig to init pid X-Git-Tag: lxc-2.1.0~239^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1329%2Fhead;p=thirdparty%2Flxc.git lxccontainer: log failure to send sig to init pid Signed-off-by: Christian Brauner --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 3a9e1e39f..d96d23eed 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1582,8 +1582,10 @@ static bool do_lxcapi_reboot(struct lxc_container *c) return false; if (c->lxc_conf && c->lxc_conf->rebootsignal) rebootsignal = c->lxc_conf->rebootsignal; - if (kill(pid, rebootsignal) < 0) + if (kill(pid, rebootsignal) < 0) { + WARN("Could not send signal %d to pid %d.", rebootsignal, pid); return false; + } return true; } @@ -1614,7 +1616,9 @@ static bool do_lxcapi_shutdown(struct lxc_container *c, int timeout) INFO("Using signal number '%d' as halt signal.", haltsignal); - kill(pid, haltsignal); + if (kill(pid, haltsignal) < 0) + WARN("Could not send signal %d to pid %d.", haltsignal, pid); + retv = do_lxcapi_wait(c, "STOPPED", timeout); return retv; }