This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goserver. commit 9f195106a671789ca5279516c7c29e816714eac7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Jul 2 23:49:00 2014 +0200 Make x2goruncommand more robust. --- debian/changelog | 1 + x2goserver/bin/x2goruncommand | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4f6d008..4b261e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -171,6 +171,7 @@ x2goserver (4.0.1.16-0x2go1) UNRELEASED; urgency=low - Use more quotes in x2goruncommand. - Detect the exit of rootless applications that forked to background on application execution. (Fixes: #122). + - Make x2goruncommand more robust. * debian/control, x2goserver.spec: + Update versioned D: x2goagent (>= 3.5.0.25). This assures that X2Go works with poly-instantiated /tmp directories. diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand index e7dcd42..3d867b8 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -258,11 +258,11 @@ if [ "$EXEC" != "" ] && [ -x "$EXEC" ]; then x2gosetkeyboard >/dev/null 2>/dev/null & - x2gofeature X2GO_XSESSION &>/dev/null && [ "x$X2GO_SESS_TYPE" = "xD" ] && { + if x2gofeature X2GO_XSESSION &>/dev/null && [ "x$X2GO_SESS_TYPE" = "xD" ]; then STARTUP="$cmd$args" "$X2GO_LIB_PATH/x2gosyslog" "$0" "notice" "launching session with Xsession-x2go mechanism, using STARTUP=\"$STARTUP\"" XSESSION_EXEC="$cmd" STARTUP="/usr/bin/env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${STARTUP}" /etc/x2go/Xsession - } || { + else "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "executing command \"$cmd$args\"..." # This is gonna be a nasty trick now... @@ -273,19 +273,20 @@ if [ "$EXEC" != "" ] && [ -x "$EXEC" ]; then STDOUT=`$EXEC_WRAPPER $cmd$args` - if [ "$X2GO_SESS_TYPE" == "R" ] && [ "$IMEXIT" == "true" ]; then + fi - # applications that managed to quit immediately, we catch here by waiting as long as x2goagent exists + if [ "$X2GO_SESS_TYPE" == "R" ] && [ "$IMEXIT" == "true" ]; then - "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "waiting for x2goagent (PID: $X2GO_AGENT_PID) to finish" - while [ -d "/proc/$X2GO_AGENT_PID" ]; do - sleep 1 - done - "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "x2goagent (PID: $X2GO_AGENT_PID) has finished" - else - "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "command $EXEC has finished" - fi - } + # applications that managed to quit immediately, we catch here by waiting as long as x2goagent exists + + "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "waiting for x2goagent (PID: $X2GO_AGENT_PID) to finish" + while [ -d "/proc/$X2GO_AGENT_PID" ]; do + sleep 1 + done + "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "x2goagent (PID: $X2GO_AGENT_PID) has finished" + else + "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "command $EXEC has finished" + fi # if we reach here the possibility of a successful command execution is rather high successful_run=true -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git