The test preventing the execution of in-container reboot right now just
checks whether or not we are running an upstream Linux Kernel. However,
it is perfectly possible to gracefuly stop the container if joining the
pid namespace is possible.

Update the test to reflect that.

Signed-off-by: Glauber Costa <[email protected]>
---
 src/lib/env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/env.c b/src/lib/env.c
index c185b3f..2da848d 100644
--- a/src/lib/env.c
+++ b/src/lib/env.c
@@ -797,7 +797,7 @@ static int env_stop(vps_handler *h, envid_t veid, const 
char *root,
        if (stop_mode == M_KILL)
                goto kill_vps;
 
-       if (!is_vz_kernel(h)) {
+       if (!is_vz_kernel(h) && !h->can_join_pidns) {
                logger(-1, 0, "Due to lack of proper support in this kernel, "
                "container can't be cleanly\n"
                "stopped from the host system. Please stop it from inside, "
-- 
1.7.11.7

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to