summaryrefslogtreecommitdiff
path: root/openrc/0009-Based-on-the-vrf-patch-it-adds-support-to-run-servic.patch
diff options
context:
space:
mode:
Diffstat (limited to 'openrc/0009-Based-on-the-vrf-patch-it-adds-support-to-run-servic.patch')
-rw-r--r--openrc/0009-Based-on-the-vrf-patch-it-adds-support-to-run-servic.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/openrc/0009-Based-on-the-vrf-patch-it-adds-support-to-run-servic.patch b/openrc/0009-Based-on-the-vrf-patch-it-adds-support-to-run-servic.patch
new file mode 100644
index 0000000..bd149d9
--- /dev/null
+++ b/openrc/0009-Based-on-the-vrf-patch-it-adds-support-to-run-servic.patch
@@ -0,0 +1,30 @@
+From 2f7405254f16cbb33ddb7c57eb20606a92b6c84a Mon Sep 17 00:00:00 2001
+From: Thomas Liske <thomas@fiasko-nw.net>
+Date: Sat, 16 Sep 2023 18:25:42 +0200
+Subject: [PATCH] Based on the vrf patch it adds support to run services in
+ netns namespaces. It is even possible to stack both options and run services
+ in a VRF inside a netns namespace.
+
+---
+ sh/openrc-run.sh.in | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in
+index 5eb4224c..2a6605db 100644
+--- a/sh/openrc-run.sh.in
++++ b/sh/openrc-run.sh.in
+@@ -242,6 +242,11 @@ if [ -n "$vrf" ]; then
+ RC_VRF_EXEC="/sbin/ip vrf exec $vrf"
+ fi
+
++# Add ip netns if configured to run in a netns (netns+vrf may stack)
++if [ -n "$netns" ]; then
++ RC_VRF_EXEC="/sbin/ip netns exec $netns $RC_VRF_EXEC"
++fi
++
+ # load service supervisor functions
+ sourcex "@LIBEXECDIR@/sh/runit.sh"
+ sourcex "@LIBEXECDIR@/sh/s6.sh"
+--
+2.39.2
+