[openwrt/openwrt] procd: setup /dev/stdin, /dev/stdout and /dev/stderr symlinks

LEDE Commits lede-commits at lists.infradead.org
Tue Nov 23 06:04:22 PST 2021


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/50bc06e774f89517f98c89c76a7626f35c3ff659

commit 50bc06e774f89517f98c89c76a7626f35c3ff659
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Thu Nov 18 13:00:09 2021 +0100

    procd: setup /dev/stdin, /dev/stdout and /dev/stderr symlinks
    
    Extend the hotplug.json ruleset to setup the common /dev/std{in,out,err}
    symbolic links which are needed by some applications, e.g. nftables when
    applying rulesets from stdin.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/system/procd/files/hotplug.json | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/package/system/procd/files/hotplug.json b/package/system/procd/files/hotplug.json
index 7e0f129d35..b930b307a4 100644
--- a/package/system/procd/files/hotplug.json
+++ b/package/system/procd/files/hotplug.json
@@ -7,9 +7,19 @@
 					[ "has", "MINOR" ]
 				],
 				[
+					[ "if",
+						[ "eq", "DEVNAME", "null" ],
+						[
+							[ "makedev", "/dev/%DEVNAME%", "0666" ],
+							[ "exec", "/bin/ln", "-s", "/proc/self/fd/0", "/dev/stdin" ],
+							[ "exec", "/bin/ln", "-s", "/proc/self/fd/1", "/dev/stdout" ],
+							[ "exec", "/bin/ln", "-s", "/proc/self/fd/2", "/dev/stderr" ],
+							[ "return" ]
+						]
+					],
 					[ "if",
 						[ "eq", "DEVNAME",
-							[ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ]
+							[ "full", "ptmx", "zero", "tty", "net", "random", "urandom" ]
 						],
 						[
 							[ "makedev", "/dev/%DEVNAME%", "0666" ],



More information about the lede-commits mailing list