Commit 1fbb7fae by Stéphane Graber Committed by GitHub

Merge pull request #1329 from brauner/2016-11-27/log_signal_error_on_container_stop

lxccontainer: log failure to send sig to init pid
parents d0f03fd7 591614a7
...@@ -1582,8 +1582,10 @@ static bool do_lxcapi_reboot(struct lxc_container *c) ...@@ -1582,8 +1582,10 @@ static bool do_lxcapi_reboot(struct lxc_container *c)
return false; return false;
if (c->lxc_conf && c->lxc_conf->rebootsignal) if (c->lxc_conf && c->lxc_conf->rebootsignal)
rebootsignal = 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 false;
}
return true; return true;
} }
...@@ -1614,7 +1616,9 @@ static bool do_lxcapi_shutdown(struct lxc_container *c, int timeout) ...@@ -1614,7 +1616,9 @@ static bool do_lxcapi_shutdown(struct lxc_container *c, int timeout)
INFO("Using signal number '%d' as halt signal.", haltsignal); 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); retv = do_lxcapi_wait(c, "STOPPED", timeout);
return retv; return retv;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment