[X2Go-Commits] [x2goserver] 03/07: x2goserver/sbin/x2gocleansessions: unify log messages. Move dangling line around.

git-admin at x2go.org git-admin at x2go.org
Tue Jun 23 01:05:45 CEST 2015


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

x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.

commit c9683820054f6246e870251e3049a6a8ab56cf6e
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Mon Jun 22 23:55:34 2015 +0200

    x2goserver/sbin/x2gocleansessions: unify log messages. Move dangling line around.
---
 debian/changelog                  |    2 ++
 x2goserver/sbin/x2gocleansessions |   21 ++++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 72803d9..c0f4530 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -40,6 +40,8 @@ x2goserver (4.0.1.20-0x2go1) UNRELEASED; urgency=low
     - x2goserver/sbin/x2gocleansessions: move up session status sync a bit,
       don't update session state when session has been removed from the
       database.
+    - x2goserver/sbin/x2gocleansessions: unify log messages. Move dangling
+      line around.
   * x2goserver.spec:
     - Add sudo and logcheck as BuildRequires and Requires. Don't own
       directories that are owned by sudo and logcheck. Logcheck is not
diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index 5bedba0..a372ac9 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -215,10 +215,12 @@ elsif ($pid == 0 )
 
 			if (@sinfo[4] eq 'F')
 			{
-				syslog('debug', "@sinfo[1] is blocked");
+				syslog ('debug', "@sinfo[1]: is blocked, adding to finished list.");
+
 				# Kill the process if blocked for more than 20 seconds.
 				if ((gmtime (time) - $remembered_sessions_status_since_time{@sinfo[1]}) >= 20)
 				{
+					syslog ('debug', "@sinfo[1]: blocked for more than 20 seconds.");
 					# send SIGKILL to dangling X-server processes
 					syslog('warning', "@sinfo[1]: found stale X-server process (@sinfo[0]), sending SIGKILL");
 					system("kill", "-9", "@sinfo[0]");
@@ -227,12 +229,12 @@ elsif ($pid == 0 )
 				my $display = @sinfo[2];
 				if (-S "/tmp/.X11-unix/X$display") {
 					# remove the NX-X11 socket file (as the agent will not have managed after a kill -9)
-					syslog('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 socket file: /tmp/.X11-unix/X$display");
+					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");
+					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");
@@ -242,20 +244,21 @@ elsif ($pid == 0 )
 			}
 			elsif (! check_pid (@sinfo[0], at sinfo[1], at sinfo[12]))
 			{
+				syslog('debug', "@sinfo[1], pid @sinfo[0]: does not exist, changing status from @sinfo[4] to F");
 				system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gochangestatus 'F' @sinfo[1]");
 				my $display = @sinfo[2];
 				if (-S "/tmp/.X11-unix/X$display") {
 					# remove the NX-X11 socket 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 socket file: /tmp/.X11-unix/X$display");
+					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");
+					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]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]");
 			}
@@ -266,7 +269,7 @@ elsif ($pid == 0 )
 					if (is_suspended(@sinfo[1], at sinfo[11]))
 					{
 						system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gochangestatus S @sinfo[1]");
-						syslog('debug', "@sinfo[1] is suspended, changing status from @sinfo[4] to S");
+						syslog('debug', "@sinfo[1]: is suspended, changing status from @sinfo[4] to S");
 						syslog('debug', "@sinfo[1]: unmounting all shares");
 						system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]");
 						#remove port forwarding
@@ -282,7 +285,7 @@ elsif ($pid == 0 )
 							syslog('debug', "@sinfo[1]: unmounting all shares");
 							system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]");
 							system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2gosuspend-session @sinfo[1]");
-							syslog('debug', "@sinfo[1] was found running and has now been suspended");
+							syslog('debug', "@sinfo[1]: was found running and has now been suspended");
 						}
 						elsif ($remembered_sessions_status_since_iterations{@sinfo[1]} == 2) {
 							# Issue a diagnostic warning in case suspension was already tried, but failed to
@@ -298,7 +301,7 @@ elsif ($pid == 0 )
 						syslog('debug', "@sinfo[1]: unmounting all shares");
 						system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]");
 						system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2goterminate-session @sinfo[1]");
-						syslog('debug', "@sinfo[1] has been requested for termination via the session DB");
+						syslog('debug', "@sinfo[1]: termination has been requested via the session DB");
 						#remove port forwarding
 						system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gormforward @sinfo[1]");
 					}

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


More information about the x2go-commits mailing list