]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/start.c
Report container exit status to monitord
authorJean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
Thu, 28 Aug 2014 09:32:49 +0000 (11:32 +0200)
committerJean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
Thu, 4 Sep 2014 13:22:04 +0000 (15:22 +0200)
commit1787abcae0f52847ab9eb93e26fccded668a93b3
tree593b6c9fb6674f1fe1629337c1f56a2c54254ead
parentd6559c5d09c99e42b532a6259b98d4030dc5b616
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@ovh.net>
src/lxc/lxc_monitor.c
src/lxc/monitor.c
src/lxc/monitor.h
src/lxc/start.c