From 7b8b48950874f8ede42ccece7fc1bd9c84466eaf Mon Sep 17 00:00:00 2001 From: Zhang Wei <110207872+6ZhangWei@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:35:46 +0800 Subject: [PATCH] config_tool: modify the launchscript template Change ">>/dev/stderr" to ">&2" Although it seems that the two have the same effects, the way they work is different. The ">/dev/stderr" does an open(), it goes to the filesystem look for that file, opens and write to it. The second way, ">&2",just uses file descriptor 2. The acrnd deamon outputs the stdin and stderr messages to journal through socket. And the socket cannot be manipulated with open methods.So acrnd cannot open the "/dev/stderr" which has redirected to a socket. For successfully excuting the create_tap function in acrnd deamon, We change ">> /dev/stderr" to ">&2". For the remain ">> /dev/stderr", they all follow the echo command and will not harm the launchscript functionality. Tracked-On: #8066 Signed-off-by: Zhang Wei --- misc/config_tools/launch_config/launch_script_template.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/config_tools/launch_config/launch_script_template.sh b/misc/config_tools/launch_config/launch_script_template.sh index dd23a5a36..db11885f3 100644 --- a/misc/config_tools/launch_config/launch_script_template.sh +++ b/misc/config_tools/launch_config/launch_script_template.sh @@ -129,7 +129,7 @@ function add_virtual_device() { # Create the tap device if [[ ${options} =~ tap=([^,]+) ]]; then tap_conf="${BASH_REMATCH[1]}" - create_tap "${tap_conf}" >> /dev/stderr + create_tap "${tap_conf}" >&2 fi fi