[X2go-Commits] x2godesktopsharing.git - master (branch) updated: 3.0.1.2-25-g4802e52

X2go dev team git-admin at x2go.org
Wed Sep 28 23:17:43 CEST 2011


The branch, master has been updated
       via  4802e527534545c7ecb17d977d193e5cc246d57d (commit)
      from  caf8fd6bfb2f094a64effac706a7cb0202c2124b (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 -----------------------------------------------------------------
commit 4802e527534545c7ecb17d977d193e5cc246d57d
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Sep 28 23:10:59 2011 +0200

    Provide feature for suspending/resume x2godesktopsharing (x2godesktopsharing will be terminate on x2gosuspend-session and operations will be resumed on x2goresume-session).

-----------------------------------------------------------------------

Summary of changes:
 ...sharing-terminate => x2godesktopsharing-resume} |   13 ++++---------
 .../x2godesktopsharing-suspend                     |   18 ++++++++----------
 bin/x2godesktopsharing-terminate                   |    2 ++
 debian/changelog                                   |    3 +++
 4 files changed, 17 insertions(+), 19 deletions(-)
 copy bin/{x2godesktopsharing-terminate => x2godesktopsharing-resume} (80%)
 copy share/x2gofeature.d/x2godesktopsharing.features => bin/x2godesktopsharing-suspend (81%)

The diff of changes is:
diff --git a/bin/x2godesktopsharing-terminate b/bin/x2godesktopsharing-resume
similarity index 80%
copy from bin/x2godesktopsharing-terminate
copy to bin/x2godesktopsharing-resume
index 3a14cbc..c4ca03a 100755
--- a/bin/x2godesktopsharing-terminate
+++ b/bin/x2godesktopsharing-resume
@@ -31,14 +31,9 @@ X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
-
 X2GO_DISPLAY=$(echo $SESSION_NAME | cut -d"-" -f2)
-for process_id in `pidof x2godesktopsharing`; do
-	env_of_process=$(cat -A /proc/$process_id/environ)
-	env_of_process=${env_of_process//^@/\\n}
-	display=$(echo -e $env_of_process | egrep "^DISPLAY=.*$" | cut -d"=" -f2)
-	if echo $display | grep $X2GO_DISPLAY &>/dev/null; then
-		kill -SIGTERM $process_id
-	fi
-done
 
+test -e $HOME/.x2go/C-$SESSION_NAME/resume-desktopsharing && {
+	rm -f $HOME/.x2go/C-$SESSION_NAME/resume-desktopsharing
+	export DISPLAY=:$X2GO_DISPLAY.0 x2godesktopsharing &>/dev/null
+}
diff --git a/share/x2gofeature.d/x2godesktopsharing.features b/bin/x2godesktopsharing-suspend
similarity index 81%
copy from share/x2gofeature.d/x2godesktopsharing.features
copy to bin/x2godesktopsharing-suspend
index 2f29612..5d91716 100755
--- a/share/x2gofeature.d/x2godesktopsharing.features
+++ b/bin/x2godesktopsharing-suspend
@@ -19,18 +19,16 @@
 #
 # Copyright (C) 2011  Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
 # Copyright (C) 2011  Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
+# Copyright (C) 2011  Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+
+if [ $# -eq 1   ]; then
+	SESSION_NAME=$1
+else 
+	SESSION_NAME=$X2GO_SESSION
+fi
 
 X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
-X2GO_FEATURE=$1
-
-# check for X2go server core features
-case "$X2GO_FEATURE" in
-
-    "X2GO_DESKTOPSHARING") echo "ok"; exit 0;;
-    *) exit -1;;
-
-esac
-
+x2godesktopsharing-terminate $SESSION_NAME && touch $HOME/.x2go/C-$SESSION_NAME/resume-desktopsharing
diff --git a/bin/x2godesktopsharing-terminate b/bin/x2godesktopsharing-terminate
index 3a14cbc..9fa3e6c 100755
--- a/bin/x2godesktopsharing-terminate
+++ b/bin/x2godesktopsharing-terminate
@@ -39,6 +39,8 @@ for process_id in `pidof x2godesktopsharing`; do
 	display=$(echo -e $env_of_process | egrep "^DISPLAY=.*$" | cut -d"=" -f2)
 	if echo $display | grep $X2GO_DISPLAY &>/dev/null; then
 		kill -SIGTERM $process_id
+		exit 0
 	fi
 done
 
+exit -1
\ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index 15d5308..44c13ae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,9 @@ x2godesktopsharing (3.0.1.3-0~x2go1) UNRELEASED; urgency=low
     - Add script x2godesktopsharing-terminate: detect x2godesktopsharing process
       of a given session and terminate that process.
     - Save settings and tidy up lock and socket file on X-Server crash.
+    - Provide feature for suspending/resume x2godesktopsharing (x2godesktopsharing
+      will be terminate on x2gosuspend-session and operations will be resumed on
+      x2goresume-session).
   * Depend on x2goserver (>=3.0.99.6).
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Mon, 13 Jun 2011 20:39:33 +0200


hooks/post-receive
-- 
x2godesktopsharing.git (Desktop Sharing for X2go)

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 "x2godesktopsharing.git" (Desktop Sharing for X2go).




More information about the x2go-commits mailing list