From 7b171ef04afab139b3243894ff195ce8a58f9341 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 4 Oct 2016 14:31:18 +0200 Subject: [pvs2] Implement hybrid mode where the manager is running on the second virtual desktop --- .../pvs2/data/opt/openslx/scripts/setup-pvsmgr | 8 +------ .../openslx/vmchooser/sessionstart.d/50-PVSclient | 26 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr b/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr index f58ce099..f39e03aa 100755 --- a/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr +++ b/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr @@ -2,11 +2,5 @@ openbox & -. /opt/openslx/config -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}')" - wget -O "$HOME/.config/openslx/pvs2/pvs2.ini" "$SLX_PVS_CONFIG_URL" -fi +exec /opt/openslx/bin/pvsmgr "$@" -exec /opt/openslx/bin/pvsmgr --manager-only diff --git a/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient b/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient index 0b13b39b..a2d56049 100755 --- a/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient +++ b/remote/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,32 @@ 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 + +. /opt/openslx/config +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}')" + wget -O "$HOME/.config/openslx/pvs2/pvs2.ini" "$SLX_PVS_CONFIG_URL" +fi + # If the ENV var PVS has been set by vmchooser start pvsclient -if [ -n "$PVS_AUTO_CONNECT" -a "$PVS_AUTO_CONNECT" == "TRUE" ]; then +if [ "$PVS_AUTO_CONNECT" == "TRUE" ]; then pvsstartup --auto & else pvsstartup & 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 --manager-only & + for i in 250 250 500 500 1000; do + usleep $(( i * 1000 )) || sleep 1 + wmctrl -r "$wt" -t 1 + done + } & +fi + exit 0 -- cgit v1.2.3-55-g7522