[X2Go-Commits] [x2goserver] 02/02: Remove stale X11 lock files in cases where x2goagent mysteriously disappeared (e.g., due to kill -9 or a crash). (Fixes: #630).

git-admin at x2go.org git-admin at x2go.org
Mon Oct 6 22:19:07 CEST 2014


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goserver.

commit 8550011eb7db3e3293c58f53f09ff704dd1e5924
Author: Horst Schirmeier <horst at schirmeier.com>
Date:   Mon Oct 6 22:17:25 2014 +0200

    Remove stale X11 lock files in cases where x2goagent mysteriously disappeared (e.g., due to kill -9 or a crash). (Fixes: #630).
---
 debian/changelog                  |    5 ++++-
 x2goserver/sbin/x2gocleansessions |   12 +++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index fb8856e..6f850a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -126,7 +126,10 @@ x2goserver (4.1.0.0-0x2go1.1) UNRELEASED; urgency=low
 
 x2goserver (4.0.1.18-0x2go1) UNRELEASED; urgency=medium
 
-  * Continue development...
+  [ Horst Schirmeier ]
+  * New upstream release (4.0.1.18):
+    - Remove stale X11 lock files in cases where x2goagent mysteriously
+      disappeared (e.g., due to kill -9 or a crash). (Fixes: #630).
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Mon, 06 Oct 2014 22:13:22 +0200
 
diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index eb1bd3f..5fad4b2 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,7 +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");
 				}
-				syslog('debug', "@sinfo[1], pid @sinfo[0] does not exist, changing status from @sinfo[4] to F");
+				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]");
 			}

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list