Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
namespace question?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1404
Location: Richmond Hill, Canada

PostPosted: Thu Jan 16, 2025 2:43 pm    Post subject: namespace question? Reply with quote

Is there document for how namespace destruction, what will happen?

Specifically for mount namespace. I know it seem that when a mount namespace last process end, all mounts in that namespace seems got unmounted automatically. But I am not so sure so I would like to know if this actually documented somewhere as this is by design. I don't want to depend on a side effect where something could change later without explicit notification.
Back to top
View user's profile Send private message
zen_desu
Tux's lil' helper
Tux's lil' helper


Joined: 25 Oct 2024
Posts: 104

PostPosted: Thu Jan 16, 2025 7:43 pm    Post subject: Reply with quote

I think you have the right idea. Namespaces exist for processes, so once the process dies, so do any mounts in the namespace.

I looked for explicit docs on this and don't think I found anything that just says that, but in testing I found it to be true.

I use this for "quick and easy" cleanup for genTree.
_________________
µgRD dev
Wiki writer
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1404
Location: Richmond Hill, Canada

PostPosted: Thu Jan 16, 2025 8:12 pm    Post subject: Reply with quote

zen_desu wrote:
I think you have the right idea. Namespaces exist for processes, so once the process dies, so do any mounts in the namespace.

I looked for explicit docs on this and don't think I found anything that just says that, but in testing I found it to be true.

I use this for "quick and easy" cleanup for genTree.


Thank your confirmation.

I just hope it is documented behaviour. As I am too designing my build process (kind like yours genTree) I just wish it is firmed kernel feature.
Back to top
View user's profile Send private message
spica
Guru
Guru


Joined: 04 Jun 2021
Posts: 337

PostPosted: Thu Jan 16, 2025 8:34 pm    Post subject: Reply with quote

There's one thing, if an opened file descriptor exists for something under /proc/{pid}/ns or it is bind mounted then namespace is kept, even if all processes in this namespace ended
~ man 7 namespaces
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1404
Location: Richmond Hill, Canada

PostPosted: Thu Jan 16, 2025 9:13 pm    Post subject: Reply with quote

spica wrote:
There's one thing, if an opened file descriptor exists for something under /proc/{pid}/ns or it is bind mounted then namespace is kept, even if all processes in this namespace ended
~ man 7 namespaces
Thank you very much for point it out!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum