[X2Go-Commits] [x2goserver] 01/01: x2goserver/sbin/x2gocleansessions: replace time check with PID validity check in check_pid and calls.

git-admin at x2go.org git-admin at x2go.org
Fri Feb 28 16:34:32 CET 2020


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

x2go pushed a commit to branch master
in repository x2goserver.

commit c2182644e53b5038911f13f994c574298dec3f1c
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Feb 28 16:33:26 2020 +0100

    x2goserver/sbin/x2gocleansessions: replace time check with PID validity check in check_pid and calls.
    
    The time check was really just a workaround to allow the agent to start
    up after a session was formally created, but we already have such a
    check in another place.
    
    Instead, treat a missing PID, which can only happen during session
    startup, as a success.
---
 debian/changelog                  | 6 ++++++
 x2goserver/sbin/x2gocleansessions | 7 +++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 79d7de01..3e27a07a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -178,6 +178,12 @@ x2goserver (4.1.0.4-0x2go1.2) UNRELEASED; urgency=medium
       session without an agent PID entry actually means and use the value from
       x2gocleansessions.agent-startup-time (if valid) instead of a hardcoded
       value.
+    - x2goserver/sbin/x2gocleansessions: replace time check with PID validity
+      check in check_pid and calls. The time check was really just a
+      workaround to allow the agent to start up after a session was formally
+      created, but we already have such a check in another place. Instead,
+      treat a missing PID, which can only happen during session startup, as a
+      success.
   * debian/control:
     + Build-depend upon lsb-release for distro version detection.
   * debian/x2goserver.manpages:
diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index 686a3f4e..68ed9ef4 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -61,8 +61,7 @@ sub check_pid
 {
 	my $pid=shift;
 	my $sess=shift;
-	my $sec=shift;
-	if ($sec < 30)
+	if (!$pid)
 	{
 		return 1;
 	}
@@ -252,7 +251,7 @@ elsif ($pid == 0 )
 
 			if (@sinfo[4] eq 'F')
 			{
-				if (!check_pid (@sinfo[0], @sinfo[1], 100)) {
+				if (!check_pid (@sinfo[0], @sinfo[1])) {
 					# No clean up necessary, as the agent is dead.
 					# Removing sockets again would only lead to potentially
 					# overwriting the socket another session claimed in-between.
@@ -304,7 +303,7 @@ elsif ($pid == 0 )
 					system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gormforward @sinfo[1]");
 				}
 			}
-			elsif (! check_pid (@sinfo[0], at sinfo[1], at sinfo[12]))
+			elsif (! check_pid (@sinfo[0], at sinfo[1]))
 			{
 				$user = @sinfo[11];
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list