[X2Go-Commits] [x2gothinclient] 01/04: Use run-parts to initialize the TCE during runtime. (Fixes: #419).

git-admin at x2go.org git-admin at x2go.org
Fri Aug 29 12:25:10 CEST 2014


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

x2go pushed a commit to branch master
in repository x2gothinclient.

commit bfed93df7e79cc11a3dc21c13388a65f4f83a283
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Aug 29 12:22:10 2014 +0200

    Use run-parts to initialize the TCE during runtime. (Fixes: #419).
---
 common/etc/x2gothinclient_init                     |    2 +-
 .../005_x2gothinclient-wipe-home                   |    1 +
 .../010_x2gothinclient-fresh-home                  |    1 +
 common/lib/x2gothinclient_init                     |   26 ++++++++++++++++++++
 debian/changelog                                   |    1 +
 debian/x2gothinclient-common.dirs                  |    1 +
 debian/x2gothinclient-common.install               |    5 +++-
 debian/x2gothinclient-common.links                 |    1 +
 debian/x2gothinclient-minidesktop.dirs             |    3 ++-
 debian/x2gothinclient-minidesktop.install          |    1 +
 management/sbin/x2gothinclient_create              |   16 +++++++-----
 management/sbin/x2gothinclient_update              |   11 ++++++---
 .../005_x2gothinclient-wipe-home}                  |   26 --------------------
 .../010_x2gothinclient-fresh-home}                 |   10 --------
 .../950_x2gothinclient-minidesktop                 |   25 +++++++++++++++++++
 .../950_x2gothinclient-minidesktop                 |    1 +
 16 files changed, 82 insertions(+), 49 deletions(-)

diff --git a/common/etc/x2gothinclient_init b/common/etc/x2gothinclient_init
index 58c8c7f..222b261 120000
--- a/common/etc/x2gothinclient_init
+++ b/common/etc/x2gothinclient_init
@@ -1 +1 @@
-../../management/share/etc/x2gothinclient_init
\ No newline at end of file
+../lib/x2gothinclient_init
\ No newline at end of file
diff --git a/common/etc/x2gothinclient_init.d/005_x2gothinclient-wipe-home b/common/etc/x2gothinclient_init.d/005_x2gothinclient-wipe-home
new file mode 120000
index 0000000..7a071f1
--- /dev/null
+++ b/common/etc/x2gothinclient_init.d/005_x2gothinclient-wipe-home
@@ -0,0 +1 @@
+../../..//management/share/etc/x2gothinclient_init.d/005_x2gothinclient-wipe-home
\ No newline at end of file
diff --git a/common/etc/x2gothinclient_init.d/010_x2gothinclient-fresh-home b/common/etc/x2gothinclient_init.d/010_x2gothinclient-fresh-home
new file mode 120000
index 0000000..501f8ad
--- /dev/null
+++ b/common/etc/x2gothinclient_init.d/010_x2gothinclient-fresh-home
@@ -0,0 +1 @@
+../../../management/share/etc/x2gothinclient_init.d/010_x2gothinclient-fresh-home
\ No newline at end of file
diff --git a/common/lib/x2gothinclient_init b/common/lib/x2gothinclient_init
new file mode 100755
index 0000000..fdf5e56
--- /dev/null
+++ b/common/lib/x2gothinclient_init
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Copyright (C) 2007-2014 X2Go Project - http://wiki.x2go.org
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Copyright (C) 2011-2014 Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+
+set -e
+
+run-parts /etc/x2go/x2gothinclient_init.d/
+
+exit 0
diff --git a/debian/changelog b/debian/changelog
index 9d00b2a..e0664f2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,7 @@ x2gothinclient (1.5.0.0-0x2go1) UNRELEASED; urgency=low
       x2gothinclient_upgrade).
     - Assure that a tmpfs under <chroot>/root gets mounted and cleanly
       unmounted (x2gothinclient_shell, x2gothinclient_upgrade).
+    - Use run-parts to initialize the TCE during runtime. (Fixes: #419).
     - New TCE component: x2gothinclient-minidesktop. Instead of using
       X2Go Client as login manager, we launch a minimal MATE desktop and
       connect to X2Go sessions from there.
diff --git a/debian/x2gothinclient-common.dirs b/debian/x2gothinclient-common.dirs
new file mode 100644
index 0000000..f565ef2
--- /dev/null
+++ b/debian/x2gothinclient-common.dirs
@@ -0,0 +1 @@
+/etc/x2go/x2gothinclient_init.d
diff --git a/debian/x2gothinclient-common.install b/debian/x2gothinclient-common.install
index afa9abe..9a31bac 100644
--- a/debian/x2gothinclient-common.install
+++ b/debian/x2gothinclient-common.install
@@ -1 +1,4 @@
-management/share/etc/x2gothinclient_*        etc/x2go/
+management/share/etc/x2gothinclient_sessions        etc/x2go/
+common/lib/x2gothinclient_init                      usr/lib/x2go/tce/
+management/share/etc/x2gothinclient_init.d/00*      etc/x2go/x2gothinclient_init.d/
+management/share/etc/x2gothinclient_init.d/01*      etc/x2go/x2gothinclient_init.d/
diff --git a/debian/x2gothinclient-common.links b/debian/x2gothinclient-common.links
new file mode 100644
index 0000000..88e3359
--- /dev/null
+++ b/debian/x2gothinclient-common.links
@@ -0,0 +1 @@
+usr/lib/x2go/tce/x2gothinclient_init etc/x2go/x2gothinclient_init
diff --git a/debian/x2gothinclient-minidesktop.dirs b/debian/x2gothinclient-minidesktop.dirs
index 1a040a8..583b262 100644
--- a/debian/x2gothinclient-minidesktop.dirs
+++ b/debian/x2gothinclient-minidesktop.dirs
@@ -1,3 +1,4 @@
-usr/share/images/desktop-base
+etc/x2go/x2gothinclient_init.d
 etc/xdg/autostart
+usr/share/images/desktop-base
 usr/lib/x2go
\ No newline at end of file
diff --git a/debian/x2gothinclient-minidesktop.install b/debian/x2gothinclient-minidesktop.install
index 1ba07f9..7884ba5 100644
--- a/debian/x2gothinclient-minidesktop.install
+++ b/debian/x2gothinclient-minidesktop.install
@@ -1,4 +1,5 @@
 management/share/etc/x2gothinclient-minidesktop_* etc/x2go/
+management/share/etc/x2gothinclient_init.d/95*    etc/x2go/x2gothinclient_init.d/
 minidesktop/etc/lightdm.conf etc/lightdm/
 minidesktop/etc/restart.lightdm etc/lightdm/
 minidesktop/desktop/x2gothinclient-minidesktop.desktop usr/share/applications/
diff --git a/management/sbin/x2gothinclient_create b/management/sbin/x2gothinclient_create
index 8affabe..ca3a860 100755
--- a/management/sbin/x2gothinclient_create
+++ b/management/sbin/x2gothinclient_create
@@ -84,11 +84,15 @@ fi
 
 export LANG=C
 
-mkdir -p $TC_CONFIG
-test -f $TC_CONFIG/x2gothinclient_init || cp $SHAREDIR/etc/x2gothinclient_init $TC_CONFIG
-test -f $TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_start || cp $SHAREDIR/etc/x2gothinclient-${TC_FLAVOUR}_start $TC_CONFIG
-test -f $TC_CONFIG/x2gothinclient_sessions || cp $SHAREDIR/etc/x2gothinclient_sessions $TC_CONFIG
-test -f $TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_background.svg || cp $SHAREDIR/etc/x2gothinclient-${TC_FLAVOUR}_background.svg $TC_CONFIG
+# prepare TC_CONFIG files
+mkdir -p "$TC_CONFIG"
+test -f "$TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_start" || cp "$SHAREDIR/etc/x2gothinclient-${TC_FLAVOUR}_start" "$TC_CONFIG"
+test -f "$TC_CONFIG/x2gothinclient_sessions" || cp "$SHAREDIR/etc/x2gothinclient_sessions" "$TC_CONFIG"
+test -f "$TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_background.svg" || cp "$SHAREDIR/etc/x2gothinclient-${TC_FLAVOUR}_background.svg" "$TC_CONFIG"
+
+ls "$SHAREDIR/etc/x2gothinclient_init.d" | while read init_part; do
+	test -f "$TC_CONFIG/x2gothinclient_init.d/$init_part" || cp "$SHAREDIR/etc/x2gothinclient_init.d/$init_part" "$TC_CONFIG/x2gothinclient_init.d/"
+done
 
 mkdir -p $TC_CONFIG/freerdp
 test -f $TC_CONFIG/freerdp/known_hosts || echo "# X2Go TCE: validate allowed RDP servers with their fingerprints through this file" > $TC_CONFIG/freerdp/known_hosts
@@ -279,7 +283,7 @@ empty_folder "$TC_CHROOT/var/lib/xkb"
 empty_folder "$TC_CHROOT/var/lib/dbus"
 empty_folder "$TC_CHROOT/var/lib/alsa"
 
-x2gothinclient_update
+x2gothinclient-update
 
 echo "X2Go Thin Client creation has finished successfully."
 echo
diff --git a/management/sbin/x2gothinclient_update b/management/sbin/x2gothinclient_update
index cba4788..df5d149 100755
--- a/management/sbin/x2gothinclient_update
+++ b/management/sbin/x2gothinclient_update
@@ -61,10 +61,13 @@ echo "------------------------------------------------------------"
 
 
 mkdir -p "$TC_CHROOT/etc/x2go/"
-if test -f $TC_CONFIG/x2gothinclient_init; then
-	cp -v "$TC_CONFIG/x2gothinclient_init" "$TC_CHROOT/etc/x2go/x2gothinclient_init"
-	chmod a+rx $TC_CHROOT/etc/x2go/x2gothinclient_init
-fi
+
+ls "$TC_CONFIG/x2gothinclient_init.d/" | while read init_part; do
+	if test -f "$TC_CONFIG/x2gothinclient_init.d/$init_part"; then
+		cp -v "$TC_CONFIG/x2gothinclient_init.d/$init_part" "$TC_CHROOT/etc/x2go/x2gothinclient_init.d/"
+		chmod a+rx "$TC_CHROOT/etc/x2go/x2gothinclient_init.d/$init_part"
+	fi
+done
 
 if test -f $TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_start; then
 	cp -v "$TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_start" "$TC_CHROOT/etc/x2go/x2gothinclient-${TC_FLAVOUR}_start"
diff --git a/management/share/etc/x2gothinclient_init b/management/share/etc/x2gothinclient_init.d/005_x2gothinclient-wipe-home
similarity index 55%
copy from management/share/etc/x2gothinclient_init
copy to management/share/etc/x2gothinclient_init.d/005_x2gothinclient-wipe-home
index 61cf8f2..e427752 100755
--- a/management/share/etc/x2gothinclient_init
+++ b/management/share/etc/x2gothinclient_init.d/005_x2gothinclient-wipe-home
@@ -27,30 +27,4 @@ if [ -z "$X2GO_HANDLE_DAEMON" ]; then
 		done
 		find ~x2gothinclient -mindepth 1 -type d -delete
 	fi
-	mkdir -p ~x2gothinclient
-	mkdir -p ~x2gothinclient/.x2goclient
-	if [ -e /etc/x2go/x2gothinclient_sessions ]; then
-		 cp /etc/x2go/x2gothinclient_sessions ~x2gothinclient/.x2goclient/sessions
-	fi
-	if [ -e /etc/x2go/freerdp/known_hosts ]; then
-		mkdir -p ~x2gothinclient/.freerdp
-		cp /etc/x2go/freerdp/known_hosts ~x2gothinclient/.freerdp/known_hosts
-	fi
-	if [ -e /etc/xdg/autostart/x2gothinclient-minidesktop.desktop ]; then
-		mkdir -p ~x2gothinclient/Desktop
-		cp /etc/xdg/autostart/x2gothinclient-minidesktop.desktop ~x2gothinclient/Desktop/
-	fi
-	mkdir -p ~x2gothinclient/.kde
-	mkdir -p ~x2gothinclient/.kde/socket-`hostname`
-	mkdir -p ~x2gothinclient/mounts
-	mkdir -p ~x2gothinclient/export
-	mkdir -p ~x2gothinclient/logins
-	mkdir -p ~x2gothinclient/.ssh
-	mkdir -p ~x2gothinclient/.x2go
-	chown x2gothinclient:x2gothinclient ~x2gothinclient -Rf
-	chmod go-rwx ~x2gothinclient -Rf
-fi
-
-if [ -e /usr/share/doc/x2gothinclient-minidesktop ]; then
-	. /etc/X11/Xsession
 fi
diff --git a/management/share/etc/x2gothinclient_init b/management/share/etc/x2gothinclient_init.d/010_x2gothinclient-fresh-home
similarity index 86%
rename from management/share/etc/x2gothinclient_init
rename to management/share/etc/x2gothinclient_init.d/010_x2gothinclient-fresh-home
index 61cf8f2..df8fe63 100755
--- a/management/share/etc/x2gothinclient_init
+++ b/management/share/etc/x2gothinclient_init.d/010_x2gothinclient-fresh-home
@@ -21,12 +21,6 @@
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 if [ -z "$X2GO_HANDLE_DAEMON" ]; then
-	if [ -d ~x2gothinclient ]; then
-		find ~x2gothinclient -mindepth 1 -type f | egrep -v "(\.Xauthority|.dmrc)" | while read file; do
-			rm -vf "$file"
-		done
-		find ~x2gothinclient -mindepth 1 -type d -delete
-	fi
 	mkdir -p ~x2gothinclient
 	mkdir -p ~x2gothinclient/.x2goclient
 	if [ -e /etc/x2go/x2gothinclient_sessions ]; then
@@ -50,7 +44,3 @@ if [ -z "$X2GO_HANDLE_DAEMON" ]; then
 	chown x2gothinclient:x2gothinclient ~x2gothinclient -Rf
 	chmod go-rwx ~x2gothinclient -Rf
 fi
-
-if [ -e /usr/share/doc/x2gothinclient-minidesktop ]; then
-	. /etc/X11/Xsession
-fi
diff --git a/management/share/etc/x2gothinclient_init.d/950_x2gothinclient-minidesktop b/management/share/etc/x2gothinclient_init.d/950_x2gothinclient-minidesktop
new file mode 100755
index 0000000..2dddcc7
--- /dev/null
+++ b/management/share/etc/x2gothinclient_init.d/950_x2gothinclient-minidesktop
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Copyright (C) 2010-2012 by X2Go project, http://wiki.x2go.org
+#       Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
+#       Moritz 'Morty' Struebe <Moritz.Struebe at informatik.uni-erlangen.de>
+#       Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+
+# X2Go is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# X2Go is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+if [ -e /usr/share/doc/x2gothinclient-minidesktop ]; then
+	. /etc/X11/Xsession
+fi
diff --git a/minidesktop/etc/x2gothinclient_init.d/950_x2gothinclient-minidesktop b/minidesktop/etc/x2gothinclient_init.d/950_x2gothinclient-minidesktop
new file mode 120000
index 0000000..56012a1
--- /dev/null
+++ b/minidesktop/etc/x2gothinclient_init.d/950_x2gothinclient-minidesktop
@@ -0,0 +1 @@
+../../../management/share/etc/x2gothinclient_init.d/950_x2gothinclient-minidesktop
\ No newline at end of file

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


More information about the x2go-commits mailing list