summaryrefslogtreecommitdiffstats
path: root/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
diff options
context:
space:
mode:
authorJonathan Bauer2016-12-23 13:12:09 +0100
committerJonathan Bauer2016-12-23 13:12:09 +0100
commit6806ae4a850fc7785a8c05304237cf53b5b8f951 (patch)
treeb1dd8413d6c7b9a250251da7f0d49bb52b4ddc57 /core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
parentwrong kernel version variable used (diff)
downloadmltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.tar.gz
mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.tar.xz
mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.zip
merge with latest dev version (tm-scripts commit f5a59daf8d70a9027118292cd40b18c221897408)
Diffstat (limited to 'core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient')
-rwxr-xr-xcore/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient41
1 files changed, 37 insertions, 4 deletions
diff --git a/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient b/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
index 0ad739e0..5ff03227 100755
--- a/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
+++ b/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
@@ -1,6 +1,6 @@
#!/bin/ash
-# SESSION_TYPE can be either 'VSESSION' or 'XSESSION' - currently not evaluated
+# SESSION_TYPE can be either 'VSESSION' or 'XSESSION'
# detect session command of the PVS-Manager session by looking at the xsession file
PVSMGR_SESSION_CMD=
@@ -17,10 +17,43 @@ if [ -n "${PVSMGR_SESSION_CMD}" ]; then
# do not start pvsclient if we are running the pvs manager session
[ "x${SESSION_CMD}" == "x${PVSMGR_SESSION_CMD}" ] && exit 0
fi
+
+# Download fresh copy of config file if possible
+. /opt/openslx/config
+PVSCONFIG=
+if [ -n "$SLX_PVS_CONFIG_URL" ]; then
+ [ -z "$UID" ] && UID="$(id -u)"
+ [ -z "$HOME" ] && HOME="$(getent passwd "$UID" | head -n 1 | awk -F ':' '{print $6}')"
+ mkdir -p "$HOME/.tmp"
+ if wget -T 5 -O "$HOME/.tmp/pvs2.ini.tmp" "$SLX_PVS_CONFIG_URL"; then
+ mv -f "$HOME/.tmp/pvs2.ini.tmp" "$HOME/.tmp/pvs2.ini"
+ fi
+ if ! [ -s "$HOME/.tmp/pvs2.ini" ] && [ -s "/opt/openslx/pvs2/pvs2.ini" ]; then
+ cp -f "/opt/openslx/pvs2/pvs2.ini" "$HOME/.tmp/pvs2.ini"
+ fi
+ if [ -s "$HOME/.tmp/pvs2.ini" ]; then
+ PVSCONFIG="--config=$HOME/.tmp/pvs2.ini"
+ fi
+fi
+
# If the ENV var PVS has been set by vmchooser start pvsclient
-if [ -n "$PVS_AUTO_CONNECT" -a "$PVS_AUTO_CONNECT" == "TRUE" ]; then
- pvsclient --auto &
+if [ "$PVS_AUTO_CONNECT" == "TRUE" ]; then
+ pvsstartup "$PVSCONFIG" --auto &
else
- pvsclient &
+ pvsstartup "$PVSCONFIG" &
fi
+
+# Finally, handle hybrid mode where the pvsmgr is launched on the second desktop
+# alongside the actual vm. (make sure this is a VSESSION!)
+if [ "$SESSION_TYPE" == "VSESSION" ]; then
+ {
+ wt="PVS2-Manager"
+ pvsmgr "$PVSCONFIG" --manager-only &
+ for i in 100 100 200 200 200 300 500 500 1000; do
+ usleep $(( i * 1000 )) || sleep 1
+ wmctrl -r "$wt" -t 1
+ done
+ } &
+fi
+
exit 0