Subject: Bug#820: Fwd: [X2Go-Dev] Patch: x2goserver: x2goruncommand - set IMEXIT="true" for gnome-terminal

From: Mihai Moldovan <[email-masked]>
Date: Tue, 17 Mar 2015 06:41:10 +0100

Package: x2goserver
Version 4.0.1.19
Tag: patch
Submitter: Rok Mandeljc <[email-masked]>

-------- Forwarded Message --------
Subject: 	[X2Go-Dev] Patch: x2goserver: x2goruncommand - set
IMEXIT="true" for gnome-terminal
Date: 	Mon, 16 Mar 2015 23:01:05 +0100
From: 	Rok Mandeljc <[email-masked]>
To: 	[email-masked]

Hello,

I have been trying to set up x2goserver on my Fedora 21 boxes, and
gnome-terminal seems to be failing with symptoms similar to those
described in #268.

It seems that x2goruncommand has been reworked a bit since that patch,
and now attempts to force the forking programs to stay in the foreground
by capturing their output to STDOUT. Unfortunately, this does not seem
to work for gnome-terminal; the terminal window appears on the client
for a second, then closes and the session is proclaimed to be finished.
This can be fixed by explicitly setting IMEXIT="true" if called binary
is gnome-terminal, which is done by the attached patch.

Regards,
    Rok

From 55078582d8ed695b44c0bb564765636326c0c0f3 Mon Sep 17 00:00:00 2001
From: Rok Mandeljc <[email-masked]>
Date: Mon, 16 Mar 2015 22:41:12 +0100
Subject: [PATCH] x2goruncommand: set IMEXIT="true" if called binary is
 gnome-terminal

The STDOUT trick used by x2goruncommand to keep programs that fork
to background (sort of) in the foreground does not seem to have
the desired effect with gnome-terminal on Fedora 21. To make it
work, IMEXIT needs to be set to "TRUE".
---
 x2goserver/bin/x2goruncommand | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand
index ac7ff7f..5bda27b 100755
--- a/x2goserver/bin/x2goruncommand
+++ b/x2goserver/bin/x2goruncommand
@@ -274,6 +274,14 @@ then
 	fi
 fi
 
+# A work-around for gnome-terminal; the application quits immediately,
+# and we cannot keep it in foreground with STDOUT trick
+if [ "$BNAME" == "gnome-terminal" ]
+then
+        IMEXIT="true"
+fi
+
+
 if [ "$X2GO_SESS_TYPE" == "P" ]
 then
 	IMEXIT="true"
-- 
2.1.0