您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

运行命令变成僵尸后,Docker容器拒绝被杀死

运行命令变成僵尸后,Docker容器拒绝被杀死

更改为最新内核可解决此问题

发现确切的内核差异: REPRO:linux-image-3.8.0-31-generic 没有REPRO:linux-image-3.8.0-32-generic

我认为这是解决方法

+++ linux-3.8.0/kernel/pid_namespace.c
@@ -181,6 +181,7 @@
    int nr;
    int rc;
    struct task_struct *task, *me = current;
+   int init_pids = thread_group_leader(me) ? 1 : 2;

    /* Don't allow any more processes into the pid namespace */
    disable_pid_allocation(pid_ns);
@@ -230,7 +231,7 @@
     */
    for (;;) {
        set_current_state(TASK_UNINTERRUPTIBLE);
-       if (pid_ns->nr_hashed == 1)
+       if (pid_ns->nr_hashed == init_pids)
            break;
        schedule();
    }
@H_419_8@

来自这里:https :@L_301_2@/forum/#!msg/fa.linux.kernel/u4b3n4oYDQ4/GuLrXfDIYggJ

将要升级所有我们的服务器,以重现这一点,看看是否仍然存在。

其他 2022/1/1 18:19:01 有430人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶