This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goserver. from 8cffe8b debian/po: tiny fixup on author name. new a6b3b93 debian/changelog: sync up with release/4.0.1.x branch. new d0268b4 x2goserver/sbin/x2gocleansessions: don't overzealously try to remove old nxagent sockets. new e459c62 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 | 18 ++++++++++++------ x2goserver/bin/x2gostartagent | 33 ++++++++++++++++++++++++++++++--- x2goserver/sbin/x2gocleansessions | 16 +++++++++++++++- 3 files changed, 57 insertions(+), 10 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 master in repository x2goserver. commit a6b3b93d0e7fe8f2def655c6cf01bed3db25d5be Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Feb 27 12:09:06 2017 +0100 debian/changelog: sync up with release/4.0.1.x branch. --- debian/changelog | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 330dd3d..4bc8674 100644 --- a/debian/changelog +++ b/debian/changelog @@ -230,12 +230,6 @@ x2goserver (4.1.0.0-0x2go1.2) UNRELEASED; urgency=low the Makefile creates these directories correctly. * debian/x2goserver-x2goagent.install: - Re-add etc/rgb file. - * debian/po: - - Tiny fixup on author name. - - [ Martti Pitkänen ] - * debian/po: - + Translate DebConf templates to Finnish. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Mon, 04 Jul 2016 23:46:51 +0200 @@ -246,6 +240,12 @@ 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: + - Translate DebConf templates to Finnish. -- X2Go Release Manager <git-admin@x2go.org> Sun, 20 Nov 2016 12:54:13 +0100 -- 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 master in repository x2goserver. commit e459c6200452c38317f578b8529f1cc931d4baf5 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. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 2 ++ x2goserver/bin/x2gostartagent | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index c8670d5..1e3031f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -241,6 +241,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 c6cfd4e..f02b508 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -256,7 +256,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=$( @@ -266,8 +267,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
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goserver. commit d0268b4b6997fee1968d85d37e54ad4de67c5799 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. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 4 ++++ x2goserver/sbin/x2gocleansessions | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4bc8674..c8670d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -237,6 +237,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 b97513a..161b5bc 100755 --- a/x2goserver/sbin/x2gocleansessions +++ b/x2goserver/sbin/x2gocleansessions @@ -221,6 +221,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. + log_message ('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. log_message ('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)) { @@ -228,7 +242,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) { log_message ('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