This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goserver. commit dbbddb91329b91148d08f17d1eaa13c603e203b4 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jan 8 07:34:21 2018 +0100 x2goserver/bin/x2goresume-session: actually check if the old port values have been refurbished within the system and reassign them. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 2 ++ x2goserver/bin/x2goresume-session | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 52b4507..272a9b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -334,6 +334,8 @@ x2goserver (4.0.1.23-0x2go1) UNRELEASED; urgency=medium - x2goserver/lib/x2gogetfreeport: use the check_*_port functions, require current host name as a parameter and adapt x2gogetfreeport usages accordingly. + - x2goserver/bin/x2goresume-session: actually check if the old port values + have been refurbished within the system and reassign them. * x2goserver.spec: - RPMify x2goserver-xsession description. - Remove qt4 stuff, we're not using the framework here. diff --git a/x2goserver/bin/x2goresume-session b/x2goserver/bin/x2goresume-session index 4ae76b0..b48c472 100755 --- a/x2goserver/bin/x2goresume-session +++ b/x2goserver/bin/x2goresume-session @@ -161,21 +161,27 @@ FS_PORT="$(awk -F ',' '{print $14}' <<< "${SESSIONINFO}")" "${X2GO_LIB_PATH}/x2gosyslog" "${0}" 'debug' "old ports: ${GR_PORT}, ${SOUND_PORT}, ${FS_PORT}" -### FIXME ### -### THIS NEVER WORKED CORRECTLY SINCE ${SYSTEM_PORTS} HAS BEEN REPLACED BY A ${USED_PORTS} COPY ### +typeset X2GO_INTERNAL_SOURCE='1' +# Make shellcheck happy. +: "${X2GO_INTERNAL_SOURCE}" +. "${X2GO_LIB_PATH}/x2gocheckport" +unset X2GO_INTERNAL_SOURCE + +# define the full path to the ss utility +typeset ss="$(PATH="${PATH}:/usr/sbin:/sbin" type -P 'ss')" #check if saved in DB ports free -if grep -q "|${GR_PORT}|" <<< "${SYSTEM_PORTS}"; then +if ! check_system_port "${ss}" "${GR_PORT}"; then "${X2GO_LIB_PATH}/x2gosyslog" "${0}" 'debug' "port ${GR_PORT} is already in use" "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${GR_PORT}" GR_PORT='' fi -if grep -q "|${SOUND_PORT}|" <<< "${SYSTEM_PORTS}"; then +if ! check_system_port "${ss}" "${SOUND_PORT}"; then "${X2GO_LIB_PATH}/x2gosyslog" "${0}" 'debug' "port ${SOUND_PORT} is already in use" "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${SOUND_PORT}" SOUND_PORT='' fi -if grep -q "|${FS_PORT}|" <<< "${SYSTEM_PORTS}"; then +if ! check_system_port "${ss}" "${FS_PORT}"; then "${X2GO_LIB_PATH}/x2gosyslog" "${0}" 'debug' "port ${FS_PORT} is already in use" "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${FS_PORT}" FS_PORT='' @@ -210,9 +216,6 @@ if ! SSH_PORT="$("${X2GO_LIB_PATH}/x2gogetrandomport")"; then exit '5' fi -# define the full path to the ss utility -typeset ss="$(PATH="${PATH}:/usr/sbin:/sbin" type -P 'ss')" - typeset -i retry='0' typeset -i max_retry='10' typeset -i free_port='0' -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git