* [PATCH iproute2] man ip-netns: Notice about loose device when do 'del'
@ 2015-03-15 10:57 Vadim Kochan
2015-03-15 11:47 ` Christoph Schulz
2015-03-15 15:20 ` Sergei Shtylyov
0 siblings, 2 replies; 5+ messages in thread
From: Vadim Kochan @ 2015-03-15 10:57 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
From: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
man/man8/ip-netns.8 | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/man/man8/ip-netns.8 b/man/man8/ip-netns.8
index 28a9544..062564d 100644
--- a/man/man8/ip-netns.8
+++ b/man/man8/ip-netns.8
@@ -46,6 +46,9 @@ ip-netns \- process network namespace management
A network namespace is logically another copy of the network stack,
with its own routes, firewall rules, and network devices.
+By default process inherites network namespace from its parent. Initially all
+the processes shares the same default network namespace from the init process.
+
By convention a named network namespace is an object at
.BR "/var/run/netns/" NAME
that can be opened. The file descriptor resulting from opening
@@ -88,14 +91,30 @@ network namespace and assigns NAME.
.sp
If NAME is present in /var/run/netns it is umounted and the mount
point is removed. If this is the last user of the network namespace the
-network namespace will be freed, otherwise the network namespace
-persists until it has no more users. ip netns delete may fail if
-the mount point is in use in another mount namespace.
+network namespace will be freed and all physical devices will be moved to the
+default one, otherwise the network namespace persists until it has no more
+users. ip netns delete may fail if the mount point is in use in another mount
+namespace.
If
.B -all
option was specified then all the network namespace names will be removed.
+It is possible to "loose" the physical device when it was moved to netns and
+then this netns was deleted with a running process:
+
+ $ ip netns add net0
+ $ ip link set dev eth0 netns net0
+ $ ip netns exec net0 SOME_PROCESS_IN_BACKGROUND
+ $ ip netns del net0
+
+and eth0 will appear in the default netns only after SOME_PROCESS_IN_BACKGROUND
+will exit or will be killed. To prevent this the processes running in net0
+should be killed before deleting the netns:
+
+ $ ip netns pids net0 | xargs | kill
+ $ ip netns del net0
+
.TP
.B ip netns set NAME NETNSID - assign an id to a peer network namespace
.sp
--
2.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH iproute2] man ip-netns: Notice about loose device when do 'del'
2015-03-15 11:47 ` Christoph Schulz
@ 2015-03-15 11:37 ` Vadim Kochan
0 siblings, 0 replies; 5+ messages in thread
From: Vadim Kochan @ 2015-03-15 11:37 UTC (permalink / raw)
To: Christoph Schulz; +Cc: Vadim Kochan, netdev
On Sun, Mar 15, 2015 at 12:47:04PM +0100, Christoph Schulz wrote:
> Hello!
>
> Vadim Kochan schrieb am Sun, 15 Mar 2015 12:57:24 +0200:
>
> >[...]
> >+ $ ip netns pids net0 | xargs | kill
>
> Shouldn't this be rather
>
> $ ip netns pids net0 | xargs kill
>
> ?
>
>
> Regards,
>
> Christoph Schulz
>
Yes, thank you :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH iproute2] man ip-netns: Notice about loose device when do 'del'
2015-03-15 10:57 [PATCH iproute2] man ip-netns: Notice about loose device when do 'del' Vadim Kochan
@ 2015-03-15 11:47 ` Christoph Schulz
2015-03-15 11:37 ` Vadim Kochan
2015-03-15 15:20 ` Sergei Shtylyov
1 sibling, 1 reply; 5+ messages in thread
From: Christoph Schulz @ 2015-03-15 11:47 UTC (permalink / raw)
To: Vadim Kochan; +Cc: netdev
Hello!
Vadim Kochan schrieb am Sun, 15 Mar 2015 12:57:24 +0200:
> [...]
> + $ ip netns pids net0 | xargs | kill
Shouldn't this be rather
$ ip netns pids net0 | xargs kill
?
Regards,
Christoph Schulz
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH iproute2] man ip-netns: Notice about loose device when do 'del'
2015-03-15 10:57 [PATCH iproute2] man ip-netns: Notice about loose device when do 'del' Vadim Kochan
2015-03-15 11:47 ` Christoph Schulz
@ 2015-03-15 15:20 ` Sergei Shtylyov
2015-03-15 15:25 ` Vadim Kochan
1 sibling, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2015-03-15 15:20 UTC (permalink / raw)
To: Vadim Kochan, netdev
Hello.
On 3/15/2015 1:57 PM, Vadim Kochan wrote:
> From: Vadim Kochan <vadim4j@gmail.com>
Noticed a few typos...
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
> man/man8/ip-netns.8 | 25 ++++++++++++++++++++++---
> 1 file changed, 22 insertions(+), 3 deletions(-)
> diff --git a/man/man8/ip-netns.8 b/man/man8/ip-netns.8
> index 28a9544..062564d 100644
> --- a/man/man8/ip-netns.8
> +++ b/man/man8/ip-netns.8
> @@ -46,6 +46,9 @@ ip-netns \- process network namespace management
> A network namespace is logically another copy of the network stack,
> with its own routes, firewall rules, and network devices.
>
> +By default process inherites network namespace from its parent. Initially all
s/inherites/inherits/.
> +the processes shares the same default network namespace from the init process.
s/shares/share/.
> +
> By convention a named network namespace is an object at
> .BR "/var/run/netns/" NAME
> that can be opened. The file descriptor resulting from opening
> @@ -88,14 +91,30 @@ network namespace and assigns NAME.
> .sp
> If NAME is present in /var/run/netns it is umounted and the mount
> point is removed. If this is the last user of the network namespace the
> -network namespace will be freed, otherwise the network namespace
> -persists until it has no more users. ip netns delete may fail if
> -the mount point is in use in another mount namespace.
> +network namespace will be freed and all physical devices will be moved to the
> +default one, otherwise the network namespace persists until it has no more
> +users. ip netns delete may fail if the mount point is in use in another mount
> +namespace.
>
> If
> .B -all
> option was specified then all the network namespace names will be removed.
>
> +It is possible to "loose" the physical device when it was moved to netns and
Not "lose"?
> +then this netns was deleted with a running process:
[...]
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH iproute2] man ip-netns: Notice about loose device when do 'del'
2015-03-15 15:20 ` Sergei Shtylyov
@ 2015-03-15 15:25 ` Vadim Kochan
0 siblings, 0 replies; 5+ messages in thread
From: Vadim Kochan @ 2015-03-15 15:25 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Vadim Kochan, netdev
On Sun, Mar 15, 2015 at 06:20:51PM +0300, Sergei Shtylyov wrote:
> Hello.
>
> On 3/15/2015 1:57 PM, Vadim Kochan wrote:
>
> >From: Vadim Kochan <vadim4j@gmail.com>
>
> Noticed a few typos...
>
> >Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> >---
> > man/man8/ip-netns.8 | 25 ++++++++++++++++++++++---
> > 1 file changed, 22 insertions(+), 3 deletions(-)
>
> >diff --git a/man/man8/ip-netns.8 b/man/man8/ip-netns.8
> >index 28a9544..062564d 100644
> >--- a/man/man8/ip-netns.8
> >+++ b/man/man8/ip-netns.8
> >@@ -46,6 +46,9 @@ ip-netns \- process network namespace management
> > A network namespace is logically another copy of the network stack,
> > with its own routes, firewall rules, and network devices.
> >
> >+By default process inherites network namespace from its parent. Initially all
>
> s/inherites/inherits/.
>
> >+the processes shares the same default network namespace from the init process.
>
> s/shares/share/.
>
> >+
> > By convention a named network namespace is an object at
> > .BR "/var/run/netns/" NAME
> > that can be opened. The file descriptor resulting from opening
> >@@ -88,14 +91,30 @@ network namespace and assigns NAME.
> > .sp
> > If NAME is present in /var/run/netns it is umounted and the mount
> > point is removed. If this is the last user of the network namespace the
> >-network namespace will be freed, otherwise the network namespace
> >-persists until it has no more users. ip netns delete may fail if
> >-the mount point is in use in another mount namespace.
> >+network namespace will be freed and all physical devices will be moved to the
> >+default one, otherwise the network namespace persists until it has no more
> >+users. ip netns delete may fail if the mount point is in use in another mount
> >+namespace.
> >
> > If
> > .B -all
> > option was specified then all the network namespace names will be removed.
> >
> >+It is possible to "loose" the physical device when it was moved to netns and
>
> Not "lose"?
>
> >+then this netns was deleted with a running process:
>
> [...]
>
> WBR, Sergei
>
Thank You!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-03-15 15:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-15 10:57 [PATCH iproute2] man ip-netns: Notice about loose device when do 'del' Vadim Kochan
2015-03-15 11:47 ` Christoph Schulz
2015-03-15 11:37 ` Vadim Kochan
2015-03-15 15:20 ` Sergei Shtylyov
2015-03-15 15:25 ` Vadim Kochan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox