Skip to content

lsns: show namespaces only kept alive by open file descriptors #1884

@hesch

Description

@hesch

Following #1881 I updated an old question around the topic on serverfault and A.B noticed, that there is one case missing as stated in his comment.

It can happen, that a namespace is only kept alive by an open file descriptor of a program as ilustrated by A.B:

  • ip netns add foo add a namespace
  • sleep 999 4< /run/netns/foo & sleep 2 open the fd to the namespace in a background job
  • ip netns delete foo delete the namespace (only deletes the /run/netns/foo)

Now there exists a namespace with no process running in it and it has no bind mount so it does not show up in /proc/mounts, but it is still there and could be mounted back.

To me this seems to be a rather esoteric case, but if we want to show every namespace, these namespaces should be included.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions