[X2Go-Commits] x2goserver.git - build-baikal (branch) updated: 4.0.0.2-26-g556cc82
X2Go dev team
git-admin at x2go.org
Wed Dec 4 06:22:24 CET 2013
The branch, build-baikal has been updated
via 556cc823947aa4b5f36a744c4540794f2806ed20 (commit)
from 12500017a4c4f6e8e97dcec2c775d365a83e76a6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 2 --
x2goserver/sbin/x2gocleansessions | 44 ++++---------------------------------
2 files changed, 4 insertions(+), 42 deletions(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 3648e93..56eb297 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,8 +3,6 @@ x2goserver (4.0.0.3-0~x2go1) UNRELEASED; urgency=low
* New upstream version (4.0.0.3):
- Make pre-set DESTDIR and PREFIX traverse through all Makefiles.
Do not include DESTDIR in Makefile-hard-coded path in x2gosqlitewrapper.
- - Add support to x2gocleansessions to suspend session via state changes
- in the session DB.
-- Mike Gabriel <mike.gabriel at das-netzwerkteam.de> Sun, 19 May 2013 15:02:53 +0200
diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index 0be7cee..6cc0edd 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -51,20 +51,7 @@ sub check_pid
return 0;
}
-sub has_terminated
-{
- my $sess=shift;
- my $user=shift;
- my $log="/tmp/.x2go-${user}/session-C-${sess}.log";
- my $text=`tail -1 $log 2>/dev/null`;
- if ($text =~ m/Session terminated/)
- {
- return 1;
- }
- return 0;
-}
-
-sub is_suspended
+sub check_stat
{
my $sess=shift;
my $user=shift;
@@ -72,22 +59,9 @@ sub is_suspended
my $text=`tail -1 $log 2>/dev/null`;
if ($text =~ m/Session suspended/)
{
- return 1;
- }
- return 0;
-}
-
-sub is_running
-{
- my $sess=shift;
- my $user=shift;
- my $log="/tmp/.x2go-${user}/session-C-${sess}.log";
- my $text=`tail -1 $log 2>/dev/null`;
- if (!is_suspended($sess, $user) && !has_terminated($sess, $user))
- {
- return 1;
+ return 0;
}
- return 0;
+ return 1;
}
sub catch_term
@@ -142,7 +116,7 @@ elsif ($pid == 0 )
{
if (@sinfo[4]eq 'R')
{
- if (is_suspended(@sinfo[1], at sinfo[11]))
+ if (!check_stat(@sinfo[1], at sinfo[11]))
{
system("su @sinfo[11] -c \"$x2go_lib_path/x2gochangestatus 'S' @sinfo[1] \" > /dev/null");
syslog('debug', "@sinfo[1] is suspended, changing status from @sinfo[4] to S");
@@ -150,16 +124,6 @@ elsif ($pid == 0 )
system( "su @sinfo[11] -c \"export HOSTNAME && x2goumount-session @sinfo[1]\" 2> /dev/null");
}
}
- if (@sinfo[4]eq 'S')
- {
- if (is_running(@sinfo[1], at sinfo[11]))
- {
- syslog('debug', "@sinfo[1]: unmounting all shares");
- system( "su @sinfo[11] -c \"export HOSTNAME && x2goumount-session @sinfo[1]\" 2> /dev/null");
- system("su @sinfo[11] -c \"x2gosuspend-session @sinfo[1] \" > /dev/null");
- syslog('debug', "@sinfo[1] was found running and has now been suspended");
- }
- }
}
}
}
hooks/post-receive
--
x2goserver.git (X2Go Server)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goserver.git" (X2Go Server).
More information about the x2go-commits
mailing list