From 9a6d888cb624999b7b46c492bfec34221264ca1f Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 3 Aug 2018 07:30:17 +0200 Subject: [PATCH] namespaces.7: List factors that may pin a namespace into existence Various factors may pin a namespace into existence, even when it has no member processes. Signed-off-by: Michael Kerrisk --- man7/namespaces.7 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/man7/namespaces.7 b/man7/namespaces.7 index 3c155de7e..df6d87420 100644 --- a/man7/namespaces.7 +++ b/man7/namespaces.7 @@ -412,6 +412,38 @@ and Use of UTS namespaces requires a kernel that is configured with the .B CONFIG_UTS_NS option. +.\" +.SS Namespace lifetime +Absent any other factors, +a namespace is automatically torn down when the last process in +the namespace terminates or leaves the namespace. +However, there are a number of other factors that may pin +a namespace into existence even though it has no member processes. +These factors include the following: +.IP * 3 +An open file descriptor or a bind mount exists for the corresponding +.IR /proc/[pid]/ns/* +file. +.IP * +The namespace is hierarchical (i.e., a PID or user namespace), +and has a child namespace. +.IP * +It is a user namespace that owns one or more nonuser namespaces. +.IP * +It is a PID namespace, +and there is a process that refers to the namespace via a +.IR /proc/[pid]/ns/pid_for_children +symbolic link. +.IP * +It is an IPC namespace, and a corresponding mount of an +.I mqueue +filesystem (see +.BR mq_overview (7)) +refers to this namespace. +.IP * +It is an PID namespace, and a corresponding mount of a +.BR proc (5) +filesystem refers to this namespace. .SH EXAMPLE See .BR clone (2)