Subject: Bug#1031: x2goserver stops accepting new sessions after some years of working

From: Arne Wichmann <[email-masked]>
Date: Fri, 29 Apr 2016 15:46:29 +0200

Package: x2goserver
Version: 3.0.99-3
Tags: patch

After some years of working x2goserver stopped accepting sessions - after
some debugging it turned out that the list of used ports in the database
was never cleaned up.

--- /usr/sbin/x2gocleansessions 2016-01-18 12:45:22.794498999 +0100
+++ /usr/sbin/x2gocleansessions.151214  2015-12-14 16:26:55.979026003 +0100
@@ -2,10 +2,6 @@
 use Sys::Hostname;
 use strict;
 
-use lib "/usr/lib/x2go";
-use x2godbwrapper; 
-
-
 sub check_pid
 {
    my $pid=shift;
@@ -105,6 +101,5 @@
        }       
      }
   }
-  db_cleanports() or warn "cleanports failed";
  }
 }
--- /usr/lib/x2go/x2godbwrapper.pm      2016-01-18 12:05:26.544499000 +0100
+++ /usr/lib/x2go/x2godbwrapper.pm.151214       2015-12-14 16:25:17.759026003 +0100
@@ -59,12 +59,10 @@
 
 use base 'Exporter';
 
-our @EXPORT=('db_listsessions','db_listsessions_all', 'db_getservers',
-  'db_getagent', 'db_resume', 'db_changestatus', 'db_getdisplays',
-  'db_insertsession', 'db_getports', 'db_insertport', 'db_createsession',
-  'db_insertmount', 'db_getmounts', 'db_deletemount', 'db_getdisplay',
-  'dbsys_getmounts', 'dbsys_listsessionsroot', 'dbsys_listsessionsroot_all',
-  'dbsys_rmsessionsroot', 'db_cleanports');
+our @EXPORT=('db_listsessions','db_listsessions_all', 'db_getservers', 'db_getagent', 'db_resume', 'db_changestatus', 
+            'db_getdisplays', 'db_insertsession', 'db_getports', 'db_insertport', 'db_createsession', 'db_insertmount', 
+            'db_getmounts', 'db_deletemount', 'db_getdisplay', 'dbsys_getmounts', 'dbsys_listsessionsroot', 
+            'dbsys_listsessionsroot_all', 'dbsys_rmsessionsroot');

@@ -409,15 +407,7 @@
        {
           return split("\n",`sudo -u x2gouser x2gosqlitewrapper getports $server`);
        }
-}
 
-# throw away all ports for which no matching session exists
-sub db_cleanports {
-  if($backend eq 'postgres') {
-    my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_;
-    my $sth=$dbh->prepare("delete from used_ports where port in (select port from used_ports natural left join sessions  where status is null)");
-    $sth->execute()or die;
-  } else { die "not implemented - possibly not needed"; }
 }
 
 sub db_getservers

-- 
[...] If you don't want to be restricted, don't agree to it. If you are
coerced, comply as much as you must to protect yourself, just don't support
it. Noone can free you but yourself. (crag, on Debian Planet)
Arne Wichmann ([email-masked])

---

From: Mihai Moldovan <[email-masked]>
Date: Sun, 10 Dec 2017 06:34:07 +0100

control: close -1

> some debugging it turned out that the list of used ports in the database

It looks like this bug was fixed in X2Go Server 3.1.0.0 (shortly after the
version you are/have been using.)

Closing up.

Mihai

---

From: [email-masked] (X2Go Bug Tracking System)
Date: Sun, 10 Dec 2017 05:35:03 +0000

This is an automatic notification regarding your Bug report
which was filed against the x2goserver package:

#1031: x2goserver stops accepting new sessions after some years of working

It has been closed by Mihai Moldovan <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mihai Moldovan <[email-masked]> by
replying to this email.

-- 
1031: http://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=1031
X2Go Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [X2Go-Dev] x2goserver stops accepting new sessions after some years of working
From: Mihai Moldovan <[email-masked]>
To: Arne Wichmann <[email-masked]>, [email-masked]
Date: Sun, 10 Dec 2017 06:34:07 +0100

control: close -1

Closing up.

Mihai

Subject: x2goserver stops accepting new sessions after some years of working
From: Arne Wichmann <[email-masked]>
To: [email-masked]
Date: Fri, 29 Apr 2016 15:46:29 +0200

Package: x2goserver
Version: 3.0.99-3
Tags: patch

 
 
 use base 'Exporter';

             
@@ -409,15 +407,7 @@
        {

 sub db_getservers