This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch release/4.0.1.x in repository x2goserver. from 6232fbb Provide support for client-side choice of clipboard security. (Fixes: #524). new 2482af8 Use more quotes in x2goruncommand. new c3afe1c Detect the exit of rootless applications that forked to background on application execution. (Fixes: #122). The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 3 ++ x2goserver/bin/x2goruncommand | 89 +++++++++++++++++++++++------------------ 2 files changed, 54 insertions(+), 38 deletions(-) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.0.1.x in repository x2goserver. commit 2482af829c7fd73ec0ed7e6f12d97f0d88b49e24 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 30 12:44:49 2014 +0200 Use more quotes in x2goruncommand. --- debian/changelog | 1 + x2goserver/bin/x2goruncommand | 50 ++++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4384a31..fd13717 100644 --- a/debian/changelog +++ b/debian/changelog @@ -48,6 +48,7 @@ x2goserver (4.0.1.16-0x2go1) UNRELEASED; urgency=low are still running/suspended during package upgrade. - Provide support for client-side choice of clipboard security. (Fixes: #524). + - Use more quotes in x2goruncommand. * 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 eedf59d..3e8dfab 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -21,15 +21,15 @@ # Copyright (C) 2007-2014 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> DISPLAY=":$1" -X2GO_AGENT_PID=$2 -X2GO_SESSION=$3 -cmd=$5 -sndsys=$6 -X2GO_SESS_TYPE=$7 +X2GO_AGENT_PID="$2" +X2GO_SESSION="$3" +cmd="$5" +sndsys="$6" +X2GO_SESS_TYPE="$7" X2GO_LIB_PATH="$(x2gopath libexec)"; -$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" +"$X2GO_LIB_PATH/x2gosyslog" "$0" "info" "$(basename $0) called with options: $@" export DISPLAY export X2GO_AGENT_PID @@ -48,22 +48,22 @@ export NX_XINERAMA_CONF test -n $KRB5CCNAME && export KRB5CCNAME # disable rastering in >= KDE4.8 and Qt4.8 -export QT_GRAPHICSSYSTEM=native +export QT_GRAPHICSSYSTEM="native" IMEXIT="false" -NX_XINERAMA_LIBS=$(x2gopath xinerama) -NX_LIBS=$(x2gopath nx-x11) +NX_XINERAMA_LIBS="$(x2gopath xinerama)" +NX_LIBS="$(x2gopath nx-x11)" test -n "$LD_LIBRARY_PATH" && \ LD_LIBRARY_PATH="$NX_XINERAMA_LIBS:$NX_LIBS:$LD_LIBRARY_PATH" || \ LD_LIBRARY_PATH="$NX_XINERAMA_LIBS:$NX_LIBS" -$X2GO_LIB_PATH/x2gosyslog "$0" "debug" "exporting LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +"$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "exporting LD_LIBRARY_PATH=$LD_LIBRARY_PATH" export LD_LIBRARY_PATH if [ "$sndsys" == "esd" ]; then - export ESPEAKER=localhost:$4 + export ESPEAKER="localhost:$4" elif [ "$sndsys" == "arts" ]; then - export ARTS_SERVER=localhost:$4 + export ARTS_SERVER="localhost:$4" fi # detect Ubuntu version via /etc/lsb-release (not supported by Debian) @@ -155,11 +155,16 @@ elif ([ "$cmd" == "UNITY" ] || [ "$cmd" == "unity" ]); then fi # on earlier Ubuntu versions or with non-Ubuntu Distros the ,,UNITY'' command in X2Go will launch the GNOME2 desktop shell +elif ([ "$cmd" == "CINNAMON" ] || [ "$cmd" == "cinnamon" ]); then + cmd="/usr/bin/gnome-session" + export DESKTOP_SESSION="cinnamon2d" + args=" --session=$DESKTOP_SESSION" + elif [ "$cmd" == "MATE" ]; then cmd="/usr/bin/mate-session" elif [ "$cmd" == "KDE" ]; then cmd="/usr/bin/startkde" -elif [ "$cmd" == "XFCE4" ]; then +elif [ "$cmd" == "XFCE4" ] || [ "$cmd" == "XFCE" ]; then cmd="/usr/bin/xfce4-session" elif [ "$cmd" == "LXDE" ]; then cmd="/usr/bin/startlxde" @@ -248,29 +253,28 @@ then X2GO_SESS_TYPE="R" fi - # run x2goserver-extensions for pre-runcommand x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions "$X2GO_SESSION" pre-runcommand || true sucessful_run=false -if [ "$EXEC" != "" ] && [ -x $EXEC ]; then - $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "running command $EXEC" +if [ "$EXEC" != "" ] && [ -x "$EXEC" ]; then + "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "running command $EXEC" x2gosetkeyboard >/dev/null 2>/dev/null & x2gofeature X2GO_XSESSION &>/dev/null && [ "x$X2GO_SESS_TYPE" = "xD" ] && { STARTUP="$cmd$args" - $X2GO_LIB_PATH/x2gosyslog "$0" "notice" "launching session with Xsession-x2go mechanism, using STARTUP=\"$STARTUP\"" + "$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 } || { - $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "executing command \"$cmd$args\"..." + "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "executing command \"$cmd$args\"..." $EXEC_WRAPPER $cmd$args } #### some applications can quit immediately, we will wait here as long as x2goagent exists if [ "$X2GO_SESS_TYPE" == "R" ] && [ "$IMEXIT" == "false" ]; then - $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "command $EXEC forked to background, waiting for agent to finish" - while [ -d /proc/$X2GO_AGENT_PID ]; do + "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "command $EXEC forked to background, waiting for agent to finish" + while [ -d "/proc/$X2GO_AGENT_PID" ]; do sleep 1 done fi @@ -281,7 +285,7 @@ if [ "$EXEC" != "" ] && [ -x $EXEC ]; then x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions "$X2GO_SESSION" post-runcommand || true else - $X2GO_LIB_PATH/x2gosyslog "$0" "err" "ERROR: command $EXEC failed to execute" + "$X2GO_LIB_PATH/x2gosyslog" "$0" "err" "ERROR: command $EXEC failed to execute" echo "X2GORUNCOMMAND ERR NOEXEC:$cmd" > "$MESSAGE_FILE" # run x2goserver-extensions for fail-runcommand @@ -292,8 +296,8 @@ fi # stop x2godesktopsharing process gracefully... x2gofeature X2GO_DESKTOPSHARING >/dev/null && x2goterminate-desktopsharing "$X2GO_SESSION" || true -kill -TERM $X2GO_AGENT_PID -$X2GO_LIB_PATH/x2gochangestatus 'F' "$X2GO_SESSION" > /dev/null +kill -TERM "$X2GO_AGENT_PID" +"$X2GO_LIB_PATH/x2gochangestatus" 'F' "$X2GO_SESSION" > /dev/null export HOSTNAME x2goumount-session "$X2GO_SESSION" -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.0.1.x in repository x2goserver. commit c3afe1c154dfeb0ba052f7506f0cadc5f6c62871 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 30 12:50:15 2014 +0200 Detect the exit of rootless applications that forked to background on application execution. (Fixes: #122). --- debian/changelog | 2 ++ x2goserver/bin/x2goruncommand | 43 +++++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index fd13717..cf009c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -49,6 +49,8 @@ x2goserver (4.0.1.16-0x2go1) UNRELEASED; urgency=low - Provide support for client-side choice of clipboard security. (Fixes: #524). - Use more quotes in x2goruncommand. + - Detect the exit of rootless applications that forked to background on + application execution. (Fixes: #122). * 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 3e8dfab..e7dcd42 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -173,10 +173,12 @@ elif [ "$cmd" == "TRINITY" ]; then fi if [ "$cmd" == "WWWBROWSER" ]; then - if [ -e "/usr/bin/firefox" ]; then - cmd="/usr/bin/firefox" + if [ -e "/usr/bin/firefox.real" ]; then + cmd="/usr/bin/firefox.real" elif [ -e "/usr/bin/iceweasel" ]; then cmd="/usr/bin/iceweasel" + elif [ -e "/usr/bin/firefox" ]; then + cmd="/usr/bin/firefox" elif [ -e "/usr/bin/abrowser" ]; then cmd="/usr/bin/abrowser" elif [ -e "/usr/bin/konqueror" ]; then @@ -209,17 +211,12 @@ if [ "$cmd" == "OFFICE" ]; then fi if [ "$cmd" == "TERMINAL" ]; then - IMEXIT="true" if [ -e "/usr/bin/konsole" ]; then cmd="/usr/bin/konsole" - # KDE4 konsole behaves differently from other terminals - IMEXIT="false" elif [ -e "/usr/bin/mate-terminal" ]; then cmd="/usr/bin/mate-terminal" elif [ -e "/usr/bin/gnome-terminal" ]; then cmd="/usr/bin/gnome-terminal" - # GNOME terminal starting with 3.8 also immediately exits - IMEXIT="false" elif [ -e "/usr/bin/lxterminal" ]; then cmd="/usr/bin/lxterminal" elif [ -e "/usr/bin/rxvt" ]; then @@ -236,7 +233,6 @@ EXEC_WRAPPER="" BNAME=`basename "$EXEC"` if [ "$BNAME" == "rdesktop" ] then - IMEXIT="true" if type padsp >/dev/null; then EXEC_WRAPPER="padsp" args=" -r sound:local" @@ -248,7 +244,7 @@ fi if [ "$X2GO_SESS_TYPE" == "P" ] then - IMEXIT="false" + IMEXIT="true" EXEC="/bin/true" X2GO_SESS_TYPE="R" fi @@ -268,16 +264,29 @@ if [ "$EXEC" != "" ] && [ -x "$EXEC" ]; then XSESSION_EXEC="$cmd" STARTUP="/usr/bin/env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${STARTUP}" /etc/x2go/Xsession } || { "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "executing command \"$cmd$args\"..." - $EXEC_WRAPPER $cmd$args + + # This is gonna be a nasty trick now... + # Most applications run in foreground (fine!), but some fork to background (urgghh... e.g. konsole, iceweasel, etc.). + # By capturing their STDOUT, we force the process to remain in (sort of) foreground until the process has finished. + # This works fabulously with all applications that don't cleanly close their file descriptors (which is probably + # 99% of all applications out there...). + + STDOUT=`$EXEC_WRAPPER $cmd$args` + + if [ "$X2GO_SESS_TYPE" == "R" ] && [ "$IMEXIT" == "true" ]; then + + # 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 } - #### some applications can quit immediately, we will wait here as long as x2goagent exists - if [ "$X2GO_SESS_TYPE" == "R" ] && [ "$IMEXIT" == "false" ]; then - "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "command $EXEC forked to background, waiting for agent to finish" - while [ -d "/proc/$X2GO_AGENT_PID" ]; do - sleep 1 - done - 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