Subject: Bug#1409: Fwd: [Bug 1754220] New: x2gocleansessions kills user desktop shortly after login (~20 secs)

From: Orion Poplawski <[email-masked]>
Date: Sun, 22 Sep 2019 16:51:51 -0600

Package: x2goserver
Version: 4.1.0.3
Tags: patch

-------- Forwarded Message --------
Subject: [Bug 1754220] New: x2gocleansessions kills user desktop shortly 
after login (~20 secs)
Date: Sat, 21 Sep 2019 22:07:05 +0000
From: [email-masked]
To: [email-masked]

https://bugzilla.redhat.com/show_bug.cgi?id=1754220

             Bug ID: 1754220
            Summary: x2gocleansessions kills user desktop shortly after
                     login (~20 secs)
            Product: Fedora
            Version: 30
             Status: NEW
          Component: x2goserver
           Assignee: [email-masked]
           Reporter: [email-masked]
         QA Contact: [email-masked]
                 CC: [email-masked]
   Target Milestone: ---
     Classification: Fedora

Description of problem:

Randomly, user sessions are booted after logging in. Usually a stable
connection can be acquired after a few retries.

Version-Release number of selected component (if applicable):

# rpm -q x2goserver
x2goserver-4.1.0.3-3.fc30.x86_64

How reproducible:

Randomly

Steps to Reproduce:

1. Login and wait 20 to 30 seconds (I was using LXDE and occasionally 
running
"sudo -i" in a terminal, but I don't think that is necessary to trigger the
bug).

Actual results:

Session killed shortly after logging in.

Expected results:

Session should not be killed.

Additional info:

To troubleshoot this issue, I did the following:

# mkdir /etc/systemd/system/x2gocleansessions.service.d
# cat << END > /etc/systemd/system/x2gocleansessions.service.d/override.conf
[Service]
Type=simple
ExecStart=
ExecStart=/usr/sbin/x2gocleansessions -d
END
# systemctl daemon-reload
# systemctl restart x2gocleansessions.service

After sprinkling /usr/sbin/x2gocleansessions with printf statements and
x2gocleansessions.service a few times, I eventually traced the problem 
down to
check_pid() being called with a NULL value for $pid (not sure why; seems 
to be
some sort of race condition). The following patch seems to resolve the 
issue.

--- x2gocleansessions.a 2019-09-21 16:46:53.327948763 -0500
+++ x2gocleansessions.b 2019-09-21 16:46:10.076184475 -0500
@@ -62,7 +62,7 @@
         my $pid=shift;
         my $sess=shift;
         my $sec=shift;
-       if ($sec < 30)
+       if (!$pid || $sec < 30)
         {
                 return 1;
         }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

---

From: Orion Poplawski <[email-masked]>
Date: Sun, 22 Sep 2019 17:04:33 -0600

-------- Forwarded Message --------
Subject: [Bug 1350004] simultaneous x2go and desktop sessions cause dbus 
conflicts
Date: Sat, 21 Sep 2019 01:32:19 +0000
From: [email-masked]
To: [email-masked]

https://bugzilla.redhat.com/show_bug.cgi?id=1350004

--- Comment #17 from Gregory Lee Bartholomew 
<[email-masked]> ---
It looks like I spoke to soon -- it has started kicking me off after 
about 20
seconds again. So I guess this work-around isn't working after all.

---

From: Orion Poplawski <[email-masked]>
Date: Sun, 22 Sep 2019 17:05:58 -0600

That was from a different bug report.

-- 
Orion Poplawski
Manager of NWRA Technical Systems          720-772-5637
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       [email-masked]
Boulder, CO 80301                 https://www.nwra.com/