[X2Go-User] X2go extension questions

Mihai Moldovan ionic at ionic.de
Sun Jul 17 08:59:46 CEST 2016


On 05.07.2016 05:14 PM, Karres, Dean wrote:
> I am running x2go client 4.0.5.1 on a windows machine and connecting to a RedHat rhel 6 machine using x2go from the default yum repo.  I am trying to create custom extensions for our local needs but am having some issues.  Documentation is rather light on this so I hope you guys can shed some light?

It is. Patches (or even just plain "text") are welcome to improve this situation.


> First, in the "fail" modalities: are these critical failures?  Does the X2Go session in question survive a failure state?

Yes, the "fail" modality is critical: it means nxagent/x2goagent failed to start
up or crashed after the fact.



> Next, I have written very simple extension shell scripts that just write the result of the "x2golistsessions" command to syslog and have put these extensions in each of the modality dirs.

This is probably better done via the debug loglevel?


> I have noticed that the "pre" & "post" "start" scripts do NOT report the process ID of the active session - the is an x2go "sessionID" but not a PID.  When is the PID assigned?  I have done a quick search through the source but it didn't jump out at me.

I think it's not at all written to the database. The only information you can
rely on is stuff written to the database. Feel free to examine the database for
more information.

sqlite> .schema sessions
CREATE TABLE sessions(
		                      session_id varchar(500) primary key,
		                      display integer not null,
		                      uname varchar(100) not null,
		                      server varchar(100) not null,
		                      client inet,
		                      status char(1) not null default 'R',
		                      init_time timestamp not null default CURRENT_TIMESTAMP,
		                      last_time timestamp not null default CURRENT_TIMESTAMP,
		                      cookie char(33),
		                      agent_pid int,
		                      gr_port int,
		                      sound_port int,
		                      fs_port int,
		                      tekictrl_port int,
		                      tekidata_port int,
		                      unique(display));
CREATE TRIGGER fkd_mounts_session_id
		                      BEFORE DELETE ON sessions
		                      FOR EACH ROW BEGIN
		                      SELECT CASE
		                      WHEN ((SELECT session_id FROM mounts WHERE session_id =
OLD.session_id) IS NOT NULL)
		                      THEN RAISE(ABORT, 'delete on table "sessions" violates
foreign key on table "mounts"')
		                      END;
		                      END;
CREATE TRIGGER fkd_ports_session_id
		                      BEFORE DELETE ON sessions
		                      FOR EACH ROW
		                      BEGIN
		                      DELETE  FROM used_ports WHERE session_id = OLD.session_id;
		                      END;



> Lastly, as mentioned above, I most often connect to a linux box from a windows desktop.  I have had occasion to have the desktop -> linux connection going and then connect from a windows laptop into the same linux machine at the same time and as the same username.  The two connections seem to get merged/confused.  Is this normal?  

Yes, that's normal. Basically, X2Go sessions are per-(UNIX)-user. If you need to
attach to an already running session, you create a new "shadow" session that is
inherently different from "normal" sessions.



Mihai

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x2go.org/pipermail/x2go-user/attachments/20160717/7daba7e5/attachment.pgp>


More information about the x2go-user mailing list