[lxc-devel] [lxc/lxc] 1787ab: Report container exit status to monitord

GitHub noreply at github.com
Mon Sep 8 16:12:34 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 1787abcae0f52847ab9eb93e26fccded668a93b3
      https://github.com/lxc/lxc/commit/1787abcae0f52847ab9eb93e26fccded668a93b3
  Author: Jean-Tiare LE BIGOT <jean-tiare.le-bigot at ovh.net>
  Date:   2014-09-04 (Thu, 04 Sep 2014)

  Changed paths:
    M src/lxc/lxc_monitor.c
    M src/lxc/monitor.c
    M src/lxc/monitor.h
    M src/lxc/start.c

  Log Message:
  -----------
  Report container exit status to monitord

When managing containers, I need to take action based on container
exit status. For instance, if it exited abnormally (status!=0), I
sometime want to respawn it automatically. Or, when invoking
`lxc-stop` I want to know if it terminated gracefully (ie on `SIGTERM`)
or on `SIGKILL` after a timeout.

This patch adds a new message type `lxc_msg_exit_code,` to preserve
ABI. It sends the raw status code as returned by `waitpid` so that
listening application may want to apply `WEXITSTATUS` before. This is
what `lxc-monitor` does.

Signed-off-by: Jean-Tiare LE BIGOT <jean-tiare.le-bigot at ovh.net>




More information about the lxc-devel mailing list