From 901271477730ed5a268666aa8fad452962462718 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 8 Sep 2025 14:26:02 +0200 Subject: [PATCH] startstop.sh: Use background instead of coprocess coproc saves stderr in some high fd and thus ssh is not disconnected when "mxstartupctl start" or "startstop.sh start" is used over non-interactive ssh. Use normal background process instead fo coproc. --- startstop.build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/startstop.build.sh b/startstop.build.sh index 52f8518..e747e95 100755 --- a/startstop.build.sh +++ b/startstop.build.sh @@ -284,11 +284,11 @@ if [[ \$(type -t srv_\${srv}_\${cmd}) = 'function' ]]; then flock 99 || exit 1 set -m - coproc { + { srv_\${srv}_\${cmd}; - } > ${LOGDIR}/srv-\${srv}.log 2>&1 - echo "\${COPROC_PID}" >> "\${PIDFILE}" - ps -o pgid= -p "\${COPROC_PID}" > "\${PGIDFILE}" + } > ${LOGDIR}/srv-\${srv}.log 2>&1 < /dev/null & + echo "\$!" >> "\${PIDFILE}" + ps -o pgid= -p "\$!" > "\${PGIDFILE}" exit ;; *)