This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goserver. from ed72cf7 More reliably sync the NX session state with the status information in the X2Go session DB. new 370c2bf Provide --updatedb feature in x2godbadmin if DB backend is PostgreSQL. new f81625e Replace D (bin:package x2goserver): libtry-tiny-perl -> libtrycatch-perl. new 8751a10 Require perl(TryCatch) instead of perl(Try::Tiny). new 27718cd typo fix The 4 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 | 5 +++- debian/control | 2 +- x2goserver.spec | 2 +- x2goserver/sbin/x2godbadmin | 68 +++++++++++++++++++++++++++++++++++++------ 4 files changed, 65 insertions(+), 12 deletions(-) -- Alioth's /srv/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 370c2bf6e459d06d170a4becde67831c207c69ea Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 17 20:27:16 2014 +0200 Provide --updatedb feature in x2godbadmin if DB backend is PostgreSQL. --- debian/changelog | 1 + x2goserver/sbin/x2godbadmin | 68 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 18eccbb..2a306f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,6 +46,7 @@ x2goserver (4.1.0.0-0x2go1.1) UNRELEASED; urgency=low where possible, avoid backticks, use more quotes in shell scripts. - Add tunneling port allocation for TeleKinesis framework. - Only use teki_* fields with PostgreSQL DB backend if TeKi is enabled. + - Provide --updatedb feature in x2godbadmin if DB backend is PostgreSQL. - Execute post-start.d extension scripts _after_ the session information has been submitted to the session DB. This allows execution of x2golistsessions and other X2Go commands in post-start.d extension scripts. diff --git a/x2goserver/sbin/x2godbadmin b/x2goserver/sbin/x2godbadmin index 50597b6..f0053af 100755 --- a/x2goserver/sbin/x2godbadmin +++ b/x2goserver/sbin/x2godbadmin @@ -25,7 +25,7 @@ use Sys::Syslog qw( :standard :macros ); use File::Path qw( make_path ); use Getopt::Long; use DBI; -use Try::Tiny; +use TryCatch; use X2Go::Config qw( get_sqlconfig ); use X2Go::Log qw( loglevel ); @@ -262,27 +262,71 @@ my $dbadminpass=<FL>; close(FL); chomp($dbadminpass); -my $dbh; +if ($updatedb) +{ + # check if the DB already exists, if not, create it... + my $dbh; + try { + $dbh = DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1, RaiseError => 1, PrintError => 0}); + } catch { + $createdb = 1; + }; + if (!$createdb) { + if ($dbh) { + my $sth_tekictrl; + my $sth_tekidata; + try { + $sth_tekictrl = $dbh->prepare(" + select tekictrl_port from sessions + "); + $sth_tekictrl->execute(); + } catch { + print "ADDING: tekictrl_port column to table sessions\n"; + $sth_tekictrl = $dbh->prepare(" + alter table sessions + add column tekictrl_port int + "); + $sth_tekictrl->execute() or die; + $sth_tekictrl->finish(); + } + try { + $sth_tekidata = $dbh->prepare(" + select tekidata_port from sessions + "); + $sth_tekidata->execute(); + } catch { + print "ADDING: tekidata_port column to table sessions\n"; + $sth_tekidata=$dbh->prepare(" + alter table sessions + add column tekidata_port int + "); + $sth_tekidata->execute() or die; + $sth_tekidata->finish(); + } + } + if ($dbh) { + $dbh->disconnect(); + } + exit(0); + } else { + print "No session DB found. Use --createdb instead of --updatedb.\n"; + } +} + if ($createdb) { - $dbh=DBI->connect("dbi:Pg:dbname=postgres;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; create_database(); - $dbh->disconnect(); - $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; create_tables(); - $dbh->disconnect(); exit(0); } if ($listusers) { - $dbh=DBI->connect("dbi:Pg:dbname=postgres;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; list_users(); - $dbh->disconnect(); exit(0); } -$dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; +my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; if ($adduser) { add_user($adduser); @@ -318,6 +362,7 @@ $dbh->disconnect(); sub list_users() { + my $dbh=DBI->connect("dbi:Pg:dbname=postgres;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; my $sth=$dbh->prepare("select rolname from pg_roles where rolname like 'x2gouser_%'"); $sth->execute()or die; printf ("%-20s DB user\n","UNIX user"); @@ -329,6 +374,7 @@ sub list_users() printf ("%-20s x2gouser_@data[0]\n",@data[0]); } $sth->finish(); + $dbh->disconnect(); } sub rm_user() @@ -411,6 +457,7 @@ sub add_user() sub create_tables() { + $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; my $sth=$dbh->prepare(" create table sessions( session_id text primary key, @@ -587,10 +634,12 @@ sub create_tables() $sth=$dbh->prepare("GRANT ALL PRIVILEGES ON sessions, messages, user_messages, used_ports, mounts TO $x2goadmin"); $sth->execute() or die; $sth->finish(); + $dbh->disconnect(); } sub create_database { + my $dbh=DBI->connect("dbi:Pg:dbname=postgres;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; #drop db if exists my $sth=$dbh->prepare("drop database if exists x2go_sessions"); $sth->execute(); @@ -608,4 +657,5 @@ sub create_database print FL $x2goadminpass; close(FL); $sth->finish(); + $dbh->disconnect(); } -- Alioth's /srv/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 f81625e42ea00469c56cba7b6fab7c8f14d7b977 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 17 20:28:30 2014 +0200 Replace D (bin:package x2goserver): libtry-tiny-perl -> libtrycatch-perl. --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2a306f2..d889003 100644 --- a/debian/changelog +++ b/debian/changelog @@ -68,6 +68,7 @@ x2goserver (4.1.0.0-0x2go1.1) UNRELEASED; urgency=low for unversioned package conflicts. + Test if telekinesis-server is installed server-side. If so, prepare the telekinesis session sub-directory. + + Replace D (bin:package x2goserver): libtry-tiny-perl -> libtrycatch-perl. * debian/x2goserver.postinst, debian/libx2go-server-db-perl: + Handle X2Go session DB creation in x2goserver _and_ perl-X2Go-Server-DB on postinst. diff --git a/debian/control b/debian/control index 373738e..e6363b8 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Depends: ${misc:Depends}, libfile-basedir-perl, libfile-readbackwards-perl, - libtry-tiny-perl, + libtrycatch-perl, libx2go-server-perl (>= ${source:Version}), libx2go-server-perl (<< ${source:Version}.1~), x2goagent (>= 2:3.5.0.25-0~), lsof, -- Alioth's /srv/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 8751a10d6ec3f31d8a4c9be7cae1d31c14b78498 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 17 20:29:52 2014 +0200 Require perl(TryCatch) instead of perl(Try::Tiny). --- debian/changelog | 1 + x2goserver.spec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d889003..3034a56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -98,6 +98,7 @@ x2goserver (4.1.0.0-0x2go1.1) UNRELEASED; urgency=low multiple times into various packages. + Make sure X2Go Server (x2gocleansessions) starts after installation. - Make sure X2Go session DB files get updated during postinst. + + Require perl(TryCatch) instead of perl(Try::Tiny). [ Guangzhou Nianguan Electronics Technology Co.Ltd. ] * New upstream version (4.1.0.0): diff --git a/x2goserver.spec b/x2goserver.spec index 270ebdb..1e438fe 100644 --- a/x2goserver.spec +++ b/x2goserver.spec @@ -37,7 +37,7 @@ Requires: openssh-server Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: perl(File::ReadBackwards) Requires: perl(Capture::Tiny) -Requires: perl(Try::Tiny) +Requires: perl(TryCatch) # We need a database # For killall in x2gosuspend-session Requires: psmisc -- Alioth's /srv/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 27718cdd8b2622c8af3c1b727c040038e227a424 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 17 20:30:02 2014 +0200 typo fix --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3034a56..7397d89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -97,7 +97,7 @@ x2goserver (4.1.0.0-0x2go1.1) UNRELEASED; urgency=low + Make sure x2goserver-*.features files do not get installed multiple times into various packages. + Make sure X2Go Server (x2gocleansessions) starts after installation. - - Make sure X2Go session DB files get updated during postinst. + + Make sure X2Go session DB files get updated during postinst. + Require perl(TryCatch) instead of perl(Try::Tiny). [ Guangzhou Nianguan Electronics Technology Co.Ltd. ] -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git