View previous topic :: View next topic |
Author |
Message |
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1404 Location: Richmond Hill, Canada
|
Posted: Thu Jan 16, 2025 2:43 pm Post subject: namespace question? |
|
|
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 |
|
|
zen_desu Tux's lil' helper
Joined: 25 Oct 2024 Posts: 104
|
Posted: Thu Jan 16, 2025 7:43 pm Post subject: |
|
|
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 |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1404 Location: Richmond Hill, Canada
|
Posted: Thu Jan 16, 2025 8:12 pm Post subject: |
|
|
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 |
|
|
spica Guru
Joined: 04 Jun 2021 Posts: 337
|
Posted: Thu Jan 16, 2025 8:34 pm Post subject: |
|
|
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 |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1404 Location: Richmond Hill, Canada
|
Posted: Thu Jan 16, 2025 9:13 pm Post subject: |
|
|
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 |
|
|
|