man: replace $(NETNS_ETC_DIR) and $(NETNS_RUN_DIR) in ip-netns(8)

These can be configured to different paths. Reflect that in the
generated documentation.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Brian Norris 2020-04-07 10:43:06 -07:00 committed by Stephen Hemminger
parent 48e05899d0
commit 8b9d5728c1
2 changed files with 15 additions and 11 deletions

View File

@ -6,7 +6,11 @@ MAN8PAGES = $(TARGETS) $(filter-out $(TARGETS),$(wildcard *.8))
all: $(TARGETS) all: $(TARGETS)
%: %.in %: %.in
sed "s|@SYSCONFDIR@|$(CONFDIR)|g" $< > $@ sed \
-e "s|@NETNS_ETC_DIR@|$(NETNS_ETC_DIR)|g" \
-e "s|@NETNS_RUN_DIR@|$(NETNS_RUN_DIR)|g" \
-e "s|@SYSCONFDIR@|$(CONFDIR)|g" \
$< > $@
distclean: clean distclean: clean

View File

@ -61,9 +61,9 @@ By default a process inherits its network namespace from its parent. Initially a
the processes share the same default network namespace from the init process. the processes share the same default network namespace from the init process.
By convention a named network namespace is an object at By convention a named network namespace is an object at
.BR "/var/run/netns/" NAME .BR "@NETNS_RUN_DIR@/" NAME
that can be opened. The file descriptor resulting from opening that can be opened. The file descriptor resulting from opening
.BR "/var/run/netns/" NAME .BR "@NETNS_RUN_DIR@/" NAME
refers to the specified network namespace. Holding that file refers to the specified network namespace. Holding that file
descriptor open keeps the network namespace alive. The file descriptor open keeps the network namespace alive. The file
descriptor can be used with the descriptor can be used with the
@ -72,13 +72,13 @@ system call to change the network namespace associated with a task.
For applications that are aware of network namespaces, the convention For applications that are aware of network namespaces, the convention
is to look for global network configuration files first in is to look for global network configuration files first in
.BR "/etc/netns/" NAME "/" .BR "@NETNS_ETC_DIR@/" NAME "/"
then in then in
.BR "/etc/". .BR "/etc/".
For example, if you want a different version of For example, if you want a different version of
.BR /etc/resolv.conf .BR /etc/resolv.conf
for a network namespace used to isolate your vpn you would name it for a network namespace used to isolate your vpn you would name it
.BR /etc/netns/myvpn/resolv.conf. .BR @NETNS_ETC_DIR@/myvpn/resolv.conf.
.B ip netns exec .B ip netns exec
automates handling of this configuration, file convention for network automates handling of this configuration, file convention for network
@ -89,24 +89,24 @@ their traditional location in /etc.
.TP .TP
.B ip netns list - show all of the named network namespaces .B ip netns list - show all of the named network namespaces
.sp .sp
This command displays all of the network namespaces in /var/run/netns This command displays all of the network namespaces in @NETNS_RUN_DIR@
.TP .TP
.B ip netns add NAME - create a new named network namespace .B ip netns add NAME - create a new named network namespace
.sp .sp
If NAME is available in /var/run/netns/ this command creates a new If NAME is available in @NETNS_RUN_DIR@ this command creates a new
network namespace and assigns NAME. network namespace and assigns NAME.
.TP .TP
.B ip netns attach NAME PID - create a new named network namespace .B ip netns attach NAME PID - create a new named network namespace
.sp .sp
If NAME is available in /var/run/netns/ this command attaches the network If NAME is available in @NETNS_RUN_DIR@ this command attaches the network
namespace of the process PID to NAME as if it were created with ip netns. namespace of the process PID to NAME as if it were created with ip netns.
.TP .TP
.B ip [-all] netns delete [ NAME ] - delete the name of a network namespace(s) .B ip [-all] netns delete [ NAME ] - delete the name of a network namespace(s)
.sp .sp
If NAME is present in /var/run/netns it is umounted and the mount If NAME is present in @NETNS_RUN_DIR@ it is umounted and the mount
point is removed. If this is the last user of the network namespace the point is removed. If this is the last user of the network namespace the
network namespace will be freed and all physical devices will be moved to the 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 default one, otherwise the network namespace persists until it has no more
@ -160,7 +160,7 @@ Once it is assigned, it's not possible to change it.
.TP .TP
.B ip netns identify [PID] - Report network namespaces names for process .B ip netns identify [PID] - Report network namespaces names for process
.sp .sp
This command walks through /var/run/netns and finds all the network This command walks through @NETNS_RUN_DIR@ and finds all the network
namespace names for network namespace of the specified process, if PID is namespace names for network namespace of the specified process, if PID is
not specified then the current process will be used. not specified then the current process will be used.
@ -201,7 +201,7 @@ and prints a line for each event it sees.
.sp .sp
Network namespace ids are used to identify a peer network namespace. This Network namespace ids are used to identify a peer network namespace. This
command displays nsids of the current network namespace and provides the command displays nsids of the current network namespace and provides the
corresponding iproute2 netns name (from /var/run/netns) if any. corresponding iproute2 netns name (from @NETNS_RUN_DIR@) if any.
The The
.B target-nsid .B target-nsid