[lxc-devel] [lxc/master] lxc-execute: print error message when failed

0x0916 on Github lxc-bot at linuxcontainers.org
Tue Jul 4 08:20:34 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 343 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170704/b588c804/attachment.bin>
-------------- next part --------------
From 6de247e3353052341724d6e11e747f44b4955b2e Mon Sep 17 00:00:00 2001
From: Long Wang <w at laoqinren.net>
Date: Tue, 4 Jul 2017 16:16:30 +0800
Subject: [PATCH] lxc-execute: print error message when failed

Signed-off-by: Long Wang <w at laoqinren.net>
---
 src/lxc/tools/lxc_execute.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lxc/tools/lxc_execute.c b/src/lxc/tools/lxc_execute.c
index 1ff96aba3..0b3309a30 100644
--- a/src/lxc/tools/lxc_execute.c
+++ b/src/lxc/tools/lxc_execute.c
@@ -160,7 +160,9 @@ int main(int argc, char *argv[])
 	bret = c->start(c, 1, my_args.argv);
 	ret = c->error_num;
 	lxc_container_put(c);
-	if (!bret)
+	if (!bret) {
+		ERROR("Failed run an application inside container");
 		exit(EXIT_FAILURE);
+	}
 	exit(ret);
 }


More information about the lxc-devel mailing list