From dfef27a5a1d80a2d3e7483390728c060e304d14f Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sun, 30 Oct 2016 18:24:15 +0100 Subject: [PATCH] tools: use correct exit code for lxc-stop When the container is already running our manpage promises to exit with 2. Let's make it so. Signed-off-by: Christian Brauner --- src/lxc/tools/lxc_stop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lxc/tools/lxc_stop.c b/src/lxc/tools/lxc_stop.c index 498aac10a..d87ed16e1 100644 --- a/src/lxc/tools/lxc_stop.c +++ b/src/lxc/tools/lxc_stop.c @@ -226,7 +226,10 @@ int main(int argc, char *argv[]) if (!c->is_running(c)) { fprintf(stderr, "%s is not running\n", c->name); - ret = EXIT_FAILURE; + /* Per our manpage we need to exit with exit code: + * 2: The specified container exists but was not running. + */ + ret = 2; goto out; } -- 2.47.2