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 78ff316 debian/po: translate DebConf templates to Finnish. new 695190c debian/changelog: sync up with master branch. new 0e6a47d x2goserver/sbin/x2gocleansessions: don't overzealously try to remove old nxagent sockets. new e7164fa x2goserver/bin/x2gostartagent: convert X2GO_PORT searching algorithm to pure bash and let script fail if no display port is available. The 3 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 | 8 ++++++++ x2goserver/bin/x2gostartagent | 33 ++++++++++++++++++++++++++++++--- x2goserver/sbin/x2gocleansessions | 16 +++++++++++++++- 3 files changed, 53 insertions(+), 4 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goserver.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 695190c2191aec08fb096a656cb5983fbb9e8d51 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Feb 27 12:10:35 2017 +0100 debian/changelog: sync up with master branch. --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 23ce919..a6e24ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl + * debian/po: + - Tiny fixup on author name. [ Martti Pitkänen ] * debian/po: -- Alioth's /srv/git/code.x2go.org/x2goserver.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 0e6a47df0245c9e0e70b2054b619f562f94e6197 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Feb 27 12:33:12 2017 +0100 x2goserver/sbin/x2gocleansessions: don't overzealously try to remove old nxagent sockets. If the nxagent process already vanished, simply forget the remembered session. Otherwise we might delete sockets that have been re-assigned to other sessions in the meantime. --- debian/changelog | 4 ++++ x2goserver/sbin/x2gocleansessions | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a6e24ee..6a28f25 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium [ Mihai Moldovan ] * New upstream version (4.0.1.21): + - x2goserver/sbin/x2gocleansessions: don't overzealously try to remove old + nxagent sockets. If the nxagent process already vanished, simply forget + the remembered session. Otherwise we might delete sockets that have been + re-assigned to other sessions in the meantime. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions index 650346f..b2c79f3 100755 --- a/x2goserver/sbin/x2gocleansessions +++ b/x2goserver/sbin/x2gocleansessions @@ -232,6 +232,20 @@ elsif ($pid == 0 ) if (@sinfo[4] eq 'F') { + if (!check_pid (@sinfo[0], @sinfo[1], 100) { + # No clean up necessary, as the agent is dead. + # Removing sockets again would only lead to potentially + # overwriting the socket another session claimed in-between. + syslog ('debug', "@sinfo[1]: in failed state, but agent is gone, forgetting."); + @remembered_finished_sessions = grep (!/\Q@sinfo[1]\E/, @remembered_finished_sessions); + delete $remembered_sessions_status{@sinfo[1]}; + delete $remembered_sessions_status_since_time{@sinfo[1]}; + delete $remembered_sessions_status_since_iterations{@sinfo[1]}; + + next; + } + + # Reaching this part means that nxagent is still executing. syslog ('debug', "@sinfo[1]: is blocked."); # Only add to finished list if it isn't in there already. if (!(grep { ((defined ($_)) && ($_ =~ m/\Q@sinfo[1]\E/)) } @remembered_finished_sessions)) { @@ -239,7 +253,7 @@ elsif ($pid == 0 ) push (@remembered_finished_sessions, join ('|', @sinfo)); } - # Kill the process if blocked for more than 20 seconds. + # Kill the process if blocked for more than 20 seconds and nxagent is still up. if ((time () - $remembered_sessions_status_since_time{@sinfo[1]}) >= 20) { syslog ('debug', "@sinfo[1]: blocked for more than 20 seconds."); -- Alioth's /srv/git/code.x2go.org/x2goserver.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 e7164fa6c0998e5817c182dd36439cc9cb4c4301 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Feb 27 14:12:20 2017 +0100 x2goserver/bin/x2gostartagent: convert X2GO_PORT searching algorithm to pure bash and let script fail if no display port is available. --- debian/changelog | 2 ++ x2goserver/bin/x2gostartagent | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6a28f25..c40c55d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium nxagent sockets. If the nxagent process already vanished, simply forget the remembered session. Otherwise we might delete sockets that have been re-assigned to other sessions in the meantime. + - x2goserver/bin/x2gostartagent: convert X2GO_PORT searching algorithm to + pure bash and let script fail if no display port is available. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent index 1b6acce..80849b7 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -254,7 +254,8 @@ ss=$(PATH="$PATH:/usr/sbin:/sbin" type -P ss); while [ "$OUTPUT" != "inserted" ]; do - USED_DISPLAYS=`$X2GO_LIB_PATH/x2gogetdisplays $HOSTNAME` + typeset -a used_displays + IFS='' read -ar used_displays < <("${X2GO_LIB_PATH}/x2gogetdisplays" "${HOSTNAME}") #Get all used in system ports from X2Go database and ss output USED_PORTS=$( @@ -264,8 +265,34 @@ while [ "$OUTPUT" != "inserted" ]; do ); X2GO_PORT=$(($X2GO_PORT + 1)) - X2GO_PORT=`echo "for(\\$i=$X2GO_PORT;\\$br ne \"true\";\\$i++){ if(\"$USED_DISPLAYS\" =~ m/\\|\\$i\\|/){\\$br=\"false\";}else{\\$br=\"true\";print \\$i;}}"|perl` - + + typeset -i search_x2go_port="0" + + # Find the next free port number. + for ((search_x2go_port = X2GO_PORT; i <= 59535; ++search_x2go_port)); do + typeset -i i="0" + typeset -i value_found="0" + + for ((i = 0; i < ${#used_displays[@]}; ++i)); do + if [[ "${used_displays[i]}" =~ /|${search_x2go_port}|/ ]]; then + # We need to continue with the next port number, + # this one is taken. + value_found="1" + break + fi + done + + # Searched the array and got nothing? Great, grab that port number! + [[ "${value_found}" -eq "0" ]] && break + done + + if [[ "${search_x2go_port}" -gt "59535" ]]; then + $X2GO_LIB_PATH/x2gosyslog "$0" "err" "no free display number available, cannot start new session" + exit -1 + fi + + X2GO_PORT="${search_x2go_port}" + #Test if the session is already in use. nxagent uses 6000+DISPLAY to open a port. Therefore this must be tested, too. NX_PORT=$(($X2GO_PORT + 6000)) if $ss -lxs 2>/dev/null | egrep "(@|)/tmp/.X11-unix/X${X2GO_PORT}(|-lock) " 1>/dev/null || -- Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git