From 5eb8b13018f85860da5efcae40cadc735fbcbf22 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/lxc_stop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/lxc_stop.c b/src/lxc/lxc_stop.c index 10ddce6a9..78a483efb 100644 --- a/src/lxc/lxc_stop.c +++ b/src/lxc/lxc_stop.c @@ -210,6 +210,9 @@ int main(int argc, char *argv[]) if (!c->is_running(c)) { fprintf(stderr, "%s is not running\n", c->name); + /* 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.3