[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:32:04 CEST 2015


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

x2go pushed a commit to branch master
in repository x2goserver.

commit 939a345a93ed07b4e63c75bcf467caf55f2e53c5
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.
    
    Cherry-picked from release/4.0.1.x branch.
---
 debian/changelog                  |    2 ++
 x2goserver/sbin/x2gocleansessions |   21 ++++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9fdff27..073f36c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -209,6 +209,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 38f62ed..a17d92e 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -208,10 +208,12 @@ elsif ($pid == 0 )
 
 			if (@sinfo[4] eq 'F')
 			{
-				log_message('debug', "@sinfo[1] is blocked");
+				log_message ('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)
 				{
+					log_message ('debug', "@sinfo[1]: blocked for more than 20 seconds.");
 					# send SIGKILL to dangling X-server processes
 					log_message('warning', "@sinfo[1]: found stale X-server process (@sinfo[0]), sending SIGKILL");
 					system("kill", "-9", "@sinfo[0]");
@@ -220,12 +222,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)
-					log_message('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 socket file: /tmp/.X11-unix/X$display");
+					log_message('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)
-					log_message('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 lock file: /tmp/.X$display-lock");
+					log_message('warning', "@sinfo[1], pid @sinfo[0]: cleaning up stale X11 lock file: /tmp/.X$display-lock");
 					unlink("/tmp/.X$display-lock");
 				}
 				log_message('debug', "@sinfo[1]: unmounting all shares");
@@ -246,20 +248,21 @@ elsif ($pid == 0 )
 					$user = $effective_user;
 				}
 
+				log_message('debug', "@sinfo[1], pid @sinfo[0]: does not exist, changing status from @sinfo[4] to F");
 				system("su", "$user", "-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)
-					log_message('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 socket file: /tmp/.X11-unix/X$display");
+					log_message('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)
-					log_message('warning', "@sinfo[1], pid @sinfo[0] cleaning up stale X11 lock file: /tmp/.X$display-lock");
+					log_message('warning', "@sinfo[1], pid @sinfo[0]: cleaning up stale X11 lock file: /tmp/.X$display-lock");
 					unlink("/tmp/.X$display-lock");
-				}				log_message('debug', "@sinfo[1], pid @sinfo[0] does not exist, changing status from @sinfo[4] to F");
+				}
 				log_message('debug', "@sinfo[1]: unmounting all shares");
 				system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]");
 			}
@@ -270,7 +273,7 @@ elsif ($pid == 0 )
 					if (session_is_suspended(@sinfo[1], at sinfo[11]))
 					{
 						system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gochangestatus S @sinfo[1]");
-						log_message('debug', "@sinfo[1] is suspended, changing status from @sinfo[4] to S");
+						log_message('debug', "@sinfo[1]: is suspended, changing status from @sinfo[4] to S");
 						log_message('debug', "@sinfo[1]: unmounting all shares");
 						system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]");
 						#remove port forwarding
@@ -286,7 +289,7 @@ elsif ($pid == 0 )
 							log_message('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]");
-							log_message('debug', "@sinfo[1] was found running and has now been suspended");
+							log_message('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
@@ -302,7 +305,7 @@ elsif ($pid == 0 )
 						log_message('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]");
-						log_message('debug', "@sinfo[1] has been requested for termination via the session DB");
+						log_message('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