[X2Go-Commits] page changed: wiki:advanced:multi-node:x2goserver-pgsql

wiki-admin at x2go.org wiki-admin at x2go.org
Mon Sep 23 21:20:16 CEST 2013


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2013/09/23 19:20
Browser     : Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0 Iceweasel/23.0
IP-Address  : 217.233.231.190
Hostname    : pD9E9E7BE.dip0.t-ipconnect.de
Old Revision: http://wiki.x2go.org/doku.php/wiki:advanced:multi-node:x2goserver-pgsql?rev=1363120776
New Revision: http://wiki.x2go.org/doku.php/wiki:advanced:multi-node:x2goserver-pgsql
Edit Summary: 
User        : sunweaver

@@ -114,6 +114,100 @@
  $ x2godbadmin --addgroup x2gousers
  </code>
  
  After that step users of the posix group ''x2gousers'' can create X2Go sessions. Of course, any other group could be used here, as well.
+ 
+ ===== Database Structure and Troubleshooting =====
+ 
+ In case it becomes necessary to edit the X2Go session database on the PostgreSQL server by hand, connect to the DB with this command:
+ 
+ ==== Connect to the database ====
+ 
+ <code>
+ $ psql --user x2godbuser --password -h
localhost --dbname x2go_sessions
+ </code>
+ 
+ As password use the password found in ''/etc/x2go/x2gosql/passwords/x2goadmin''.
+ 
+ 
+ After successful login, the ''psql'' PostgreSQL client shows these lines:
+ 
+ <file>
+ ts-01:~ # psql --user x2godbuser --password -h localhost --dbname x2go_sessions
+ Password for user x2godbuser: <hidden>
+ Welcome to psql <version>, the PostgreSQL interactive terminal.
+ 
+ Type:  \copyright for distribution terms
+        \h for help with SQL commands
+        \? for help with psql commands
+        \g or terminate with semicolon to execute query
+        \q to quit
+ 
+ x2go_sessions=>
+ </file>
+ 
+ ==== Database structure ====
+ 
+ The database has five tables:
+ 
+ <file>
+ x2go_sessions=> \dt
+              List of relations
+  Schema |     Name      | Type  |  Owner   
+ --------+---------------+-------+----------
+  public | messages      | table | postgres
+  public | mounts        | table | postgres
+  public | sessions      | table |
postgres
+  public | used_ports    | table | postgres
+  public | user_messages | table | postgres
+ (5 rows)
+ </file>
+ 
+ Three of them are important for session management: sessions, used_ports, mounts.
+ 
+ Furthermore, the database defined four views:
+ 
+ <file>
+ x2go_sessions=> \dv
+             List of relations
+  Schema |     Name      | Type |  Owner   
+ --------+---------------+------+----------
+  public | mounts_view   | view | postgres
+  public | ports_view    | view | postgres
+  public | servers_view  | view | postgres
+  public | sessions_view | view | postgres
+ (4 rows)
+ 
+ x2go_sessions=> 
+ </file>
+ 
+ If you want to show the content of a table or view, evoke this SQL command:
+ 
+ <file>
+ x2go_sessions=> select * from used_ports;
+     server    |              session_id               |   creator_id    | port  
+ --------------+---------------------------------------+-----------------+-------
+  ts-01 | mike-57-1379961697_stRTERMINAL_dp24 | x2gouser_mike
| 30019
+  ts-01 | mike-57-1379961697_stRTERMINAL_dp24 | x2gouser_mike | 30018
+  ts-01 | mike-57-1379961697_stRTERMINAL_dp24 | x2gouser_mike | 30020
+ (3 rows)
+ </file>
+ 
+ ==== Troubleshooting ====
+ 
+ If you want to remove these entries (because they are there but they by some reason should not be there), use this command set:
+ 
+ <code>
+ x2go_sessions=> delete from used_ports where port=30020;
+ DELETE 1
+ </code>
+ 
+ ... or ...
+ 
+ <code>
+ x2go_sessions=> delete from used_ports where session_id=mike-57-1379961697_stRTERMINAL_dp24;
+ DELETE 3
+ </code>
+ 
+ For further input on manipulating PostgreSQL database via the ''psql'' client tool, see the PostgreSQL reference.
  
  



-- 
This mail was generated by DokuWiki at
http://wiki.x2go.org/




More information about the x2go-commits mailing list