X2Go Bug report logs - #630
clean up stable /tmp/.X<disp>-lock files

version graph

Package: x2goserver; Maintainer for x2goserver is X2Go Developers <x2go-dev@lists.x2go.org>; Source for x2goserver is src:x2goserver.

Reported by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Date: Thu, 2 Oct 2014 16:10:01 UTC

Severity: important

Tags: pending

Fixed in version 4.0.1.18

Done: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Bug is archived. No further changes may be made.

Full log


🔗 View this message in rfc822 format

X-Loop: owner@bugs.x2go.org
Subject: Bug#630: [PATCH] Handle stale X11 lock files (Fixes: #630)
Reply-To: Horst Schirmeier <horst@schirmeier.com>, 630@bugs.x2go.org
Resent-From: Horst Schirmeier <horst@schirmeier.com>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Sat, 04 Oct 2014 11:25:02 +0000
Resent-Message-ID: <handler.630.B630.14124217163783@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: followup 630
X-X2Go-PR-Package: x2goserver
X-X2Go-PR-Keywords: pending
Received: via spool by 630-submit@bugs.x2go.org id=B630.14124217163783
          (code B ref 630); Sat, 04 Oct 2014 11:25:02 +0000
Received: (at 630) by bugs.x2go.org; 4 Oct 2014 11:21:56 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=ham
	version=3.3.2
X-Greylist: delayed 400 seconds by postgrey-1.34 at ymir.das-netzwerkteam.de; Sat, 04 Oct 2014 13:21:54 CEST
Received: from quickstop.soohrt.org (quickstop.soohrt.org [85.131.246.152])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id AF6095DCAF
	for <630@bugs.x2go.org>; Sat,  4 Oct 2014 13:21:54 +0200 (CEST)
Received: (qmail 8193 invoked by uid 1014); 4 Oct 2014 11:15:13 -0000
Date: Sat, 4 Oct 2014 13:15:13 +0200
From: Horst Schirmeier <horst@schirmeier.com>
To: 630@bugs.x2go.org
Message-ID: <20141004111513.GA24258@quickstop.soohrt.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j"
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
[Message part 1 (text/plain, inline)]
Remove stale X11 lock files in cases where x2goagent mysteriously
disappeared (e.g., due to kill -9 or a crash).  This fixes bug #630
(and #626, which hasn't really been fixed yet).  Tested against the
original scenario from bug #626.
---
 x2goserver/sbin/x2gocleansessions | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index eb1bd3f..3b3775b 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -171,6 +171,11 @@ elsif ($pid == 0 )
 					syslog('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 socket file: /tmp/.X11-unix/X$display");
 					unlink("/tmp/.X11-unix/X$display");
 				}
+				if (-e "/tmp/.X$display-lock") {
+					# remove the NX-X11 lock file (as the agent will not have managed after a kill -9)
+					syslog('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 lock file: /tmp/.X$display-lock");
+					unlink("/tmp/.X$display-lock");
+				}
 				syslog('debug', "@sinfo[1]: unmounting all shares");
 				system( "su", "@sinfo[11]", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]");
 			}
@@ -184,6 +189,12 @@ elsif ($pid == 0 )
 					syslog('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 socket file: /tmp/.X11-unix/X$display");
 					unlink("/tmp/.X11-unix/X$display");
 				}
+				if (-e "/tmp/.X$display-lock") {
+					# remove the NX-X11 lock file (we don't know how the agent disappeared,
+					# someone might have shot it with kill -9)
+					syslog('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 lock file: /tmp/.X$display-lock");
+					unlink("/tmp/.X$display-lock");
+				}
 				syslog('debug', "@sinfo[1], pid @sinfo[0] does not exist, changing status from @sinfo[4] to F");
 				syslog('debug', "@sinfo[1]: unmounting all shares");
 				system("su", "@sinfo[11]", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]");
-- 
2.0.0.5.gbce14aa

-- 
PGP-Key 0xD40E0E7A
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Thu Nov 21 20:16:04 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.