From 591614a762582b8455c87a38f23426675d508803 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sun, 27 Nov 2016 06:01:36 +0100 Subject: [PATCH] lxccontainer: log failure to send sig to init pid Signed-off-by: Christian Brauner --- src/lxc/lxccontainer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; } -- 2.47.2