This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository telekinesis. from 416baa8 Future rework and improvements of SupportingServices new d4aa53f telekinesis-server startup: Make sure no stray socat processes remain on the X2Go Server. The 1 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: .../post-start.d/000_telekinesis-server-startup | 4 +++- .../pre-resume.d/000_telekinesis-server-resume | 4 +++- .../100_telekinesis-server-suspend} | 5 +++++ .../100_telekinesis-server-terminate} | 5 +++++ 4 files changed, 16 insertions(+), 2 deletions(-) copy server/lib/x2go/extensions/{post-suspend.d/900_telekinesis-server-suspend => pre-suspend.d/100_telekinesis-server-suspend} (87%) rename server/lib/x2go/extensions/{post-suspend.d/900_telekinesis-server-suspend => pre-terminate.d/100_telekinesis-server-terminate} (87%) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/telekinesis.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository telekinesis. commit d4aa53f8f845920b5d697175f5891715581fb352 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 5 13:41:16 2014 +0200 telekinesis-server startup: Make sure no stray socat processes remain on the X2Go Server. --- .../post-start.d/000_telekinesis-server-startup | 4 +++- .../pre-resume.d/000_telekinesis-server-resume | 4 +++- .../100_telekinesis-server-suspend} | 5 +++++ .../100_telekinesis-server-terminate} | 5 +++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/server/lib/x2go/extensions/post-start.d/000_telekinesis-server-startup b/server/lib/x2go/extensions/post-start.d/000_telekinesis-server-startup index 403ac62..5653802 100755 --- a/server/lib/x2go/extensions/post-start.d/000_telekinesis-server-startup +++ b/server/lib/x2go/extensions/post-start.d/000_telekinesis-server-startup @@ -24,6 +24,7 @@ export X2GO_SESSION=$1 X2GO_SESSIONINFO=$(x2golistsessions | grep $X2GO_SESSION) TEKICTRL_PORT=$(echo $X2GO_SESSIONINFO | cut -d "|" -f15 | sed -e "s/[^0-9\-]//g") TEKIDATA_PORT=$(echo $X2GO_SESSIONINFO | cut -d "|" -f16 | sed -e "s/[^0-9\-]//g") +TEKIDATA_LOCK="$HOME/.x2go/C-${X2GO_SESSION}/telekinesis-sftp.pid" export DISPLAY=:$(echo $X2GO_SESSIONINFO | cut -d "|" -f3 | sed -e "s/[^0-9\-]//g") @@ -32,8 +33,9 @@ if [ -n "$TEKICTRL_PORT" ] && [ "x$TEKICTRL_PORT" != "x-1" ]; then # FIXME: for a short fraction of time the below socket opening allows an attacker on localhost # to sshfs into the local machine for the user who has opened this socket. This # needs to be fixed/changed!!! - (socat TCP4-LISTEN:${TEKIDATA_PORT},bind=127.0.0.1 EXEC:"/usr/lib/sftp-server -R";)& + (socat -W "$TEKIDATA_LOCK" TCP4-LISTEN:${TEKIDATA_PORT},reuseaddr,bind=127.0.0.1 EXEC:"/usr/lib/sftp-server -R";)& (telekinesis-server -setDEBUG=1 -setBINDTOPORT=${TEKICTRL_PORT} > ~/.x2go/C-${X2GO_SESSION}/telekinesis-server.log;)& + (sleep 20; ss -nl | egrep "^LISTEN.*127.0.0.1:$TEKIDATA_PORT.*" 1>/dev/null && kill -9 $(cat "$TEKIDATA_LOCK" | sed -e 's/[^0-9]*//g'); )& fi exit 0 diff --git a/server/lib/x2go/extensions/pre-resume.d/000_telekinesis-server-resume b/server/lib/x2go/extensions/pre-resume.d/000_telekinesis-server-resume index dc56092..4bad305 100755 --- a/server/lib/x2go/extensions/pre-resume.d/000_telekinesis-server-resume +++ b/server/lib/x2go/extensions/pre-resume.d/000_telekinesis-server-resume @@ -24,11 +24,13 @@ export X2GO_SESSION=$1 X2GO_SESSIONINFO=$(x2golistsessions | grep $X2GO_SESSION) TEKICTRL_PORT=$(echo $X2GO_SESSIONINFO | cut -d "|" -f15 | sed -e "s/[^0-9\-]//g") TEKIDATA_PORT=$(echo $X2GO_SESSIONINFO | cut -d "|" -f16 | sed -e "s/[^0-9\-]//g") +TEKIDATA_LOCK="$HOME/.x2go/C-${X2GO_SESSION}/telekinesis-sftp.pid" # if Telekinesis server is in use for this session, try to resume it if [ -n "$TEKICTRL_PORT" ] && [ "x$TEKICTRL_PORT" != "x-1" ]; then - (socat TCP4-LISTEN:${TEKIDATA_PORT},bind=127.0.0.1 EXEC:"/usr/lib/sftp-server -R";)& + (socat -W "$TEKIDATA_LOCK" TCP4-LISTEN:${TEKIDATA_PORT},reuseaddr,bind=127.0.0.1 EXEC:"/usr/lib/sftp-server -R";)& tekicmd -setSESSIONRESUME=1 -setX2GOSID=${X2GO_SESSION} + (sleep 20; ss -nl | egrep "^LISTEN.*127.0.0.1:$TEKIDATA_PORT.*" 1>/dev/null && kill -9 $(cat "$TEKIDATA_LOCK" | sed -e 's/[^0-9]*//g'); )& fi exit 0 diff --git a/server/lib/x2go/extensions/post-suspend.d/900_telekinesis-server-suspend b/server/lib/x2go/extensions/pre-suspend.d/100_telekinesis-server-suspend similarity index 87% copy from server/lib/x2go/extensions/post-suspend.d/900_telekinesis-server-suspend copy to server/lib/x2go/extensions/pre-suspend.d/100_telekinesis-server-suspend index 6013db0..8ba7ad7 100755 --- a/server/lib/x2go/extensions/post-suspend.d/900_telekinesis-server-suspend +++ b/server/lib/x2go/extensions/pre-suspend.d/100_telekinesis-server-suspend @@ -23,10 +23,15 @@ export X2GO_SESSION=$1 X2GO_SESSIONINFO=$(x2golistsessions | grep $X2GO_SESSION) TEKICTRL_PORT=$(echo $X2GO_SESSIONINFO | cut -d "|" -f15 | sed -e "s/[^0-9\-]//g") +TEKIDATA_LOCK="$HOME/.x2go/C-${X2GO_SESSION}/telekinesis-sftp.pid" # if Telekinesis server is in use for this session, try to resume it if [ -n "$TEKICTRL_PORT" ] && [ "x$TEKICTRL_PORT" != "x-1" ]; then tekicmd -setSESSIONSUSPEND=1 -setX2GOSID=${X2GO_SESSION} + (if [ -f "$TEKIDATA_LOCK" ]; then + sleep 20 + kill -9 $(cat "$TEKIDATA_LOCK" | sed -s 's/[^0-9]*//g');) + fi;) & fi exit 0 diff --git a/server/lib/x2go/extensions/post-suspend.d/900_telekinesis-server-suspend b/server/lib/x2go/extensions/pre-terminate.d/100_telekinesis-server-terminate similarity index 87% rename from server/lib/x2go/extensions/post-suspend.d/900_telekinesis-server-suspend rename to server/lib/x2go/extensions/pre-terminate.d/100_telekinesis-server-terminate index 6013db0..8ba7ad7 100755 --- a/server/lib/x2go/extensions/post-suspend.d/900_telekinesis-server-suspend +++ b/server/lib/x2go/extensions/pre-terminate.d/100_telekinesis-server-terminate @@ -23,10 +23,15 @@ export X2GO_SESSION=$1 X2GO_SESSIONINFO=$(x2golistsessions | grep $X2GO_SESSION) TEKICTRL_PORT=$(echo $X2GO_SESSIONINFO | cut -d "|" -f15 | sed -e "s/[^0-9\-]//g") +TEKIDATA_LOCK="$HOME/.x2go/C-${X2GO_SESSION}/telekinesis-sftp.pid" # if Telekinesis server is in use for this session, try to resume it if [ -n "$TEKICTRL_PORT" ] && [ "x$TEKICTRL_PORT" != "x-1" ]; then tekicmd -setSESSIONSUSPEND=1 -setX2GOSID=${X2GO_SESSION} + (if [ -f "$TEKIDATA_LOCK" ]; then + sleep 20 + kill -9 $(cat "$TEKIDATA_LOCK" | sed -s 's/[^0-9]*//g');) + fi;) & fi exit 0 -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/telekinesis.git