]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/lxc_monitor.c
Report container exit status to monitord
[mirror_lxc.git] / src / lxc / lxc_monitor.c
index 85993fc2fe5e853c0eb7e7190b909b3b0fd5d32d..ede19ff920545e285c208fce04d79fb67affdb9a 100644 (file)
@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <regex.h>
 #include <sys/types.h>
+#include <sys/wait.h>
 #include <errno.h>
 
 #include "lxc.h"
@@ -172,6 +173,10 @@ int main(int argc, char *argv[])
                        printf("'%s' changed state to [%s]\n",
                               msg.name, lxc_state2str(msg.value));
                        break;
+               case lxc_msg_exit_code:
+                       printf("'%s' exited with status [%d]\n",
+                              msg.name, WEXITSTATUS(msg.value));
+                       break;
                default:
                        /* ignore garbage */
                        break;