From 603048e1e9335a63f2cc8128072884ddee08d3e3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 30 Nov 2017 22:33:43 +0100 Subject: [pvs2] Make dedicated mgr mode work again with lightdm(-greeter-bwlp) --- .../lightdm/autologin.d/00-check-pvs-dedicated | 10 ++++++++ .../pvs2/data/opt/openslx/scripts/systemd-pvsmgr | 9 ------- .../openslx/vmchooser/sessionstart.d/50-PVSclient | 30 ++++++++++++---------- 3 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 core/modules/pvs2/data/opt/openslx/lightdm/autologin.d/00-check-pvs-dedicated (limited to 'core/modules/pvs2') diff --git a/core/modules/pvs2/data/opt/openslx/lightdm/autologin.d/00-check-pvs-dedicated b/core/modules/pvs2/data/opt/openslx/lightdm/autologin.d/00-check-pvs-dedicated new file mode 100644 index 00000000..420cfc5c --- /dev/null +++ b/core/modules/pvs2/data/opt/openslx/lightdm/autologin.d/00-check-pvs-dedicated @@ -0,0 +1,10 @@ +#!/bin/ash +# This file is SOURCED + +# PVSMGR? +if [ -n "$SLX_PVS_DEDICATED" ]; then + exec /opt/openslx/scripts/setup-pvsmgr +fi + +true + diff --git a/core/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr b/core/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr index 1a56e8d0..9fe09ec3 100755 --- a/core/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr +++ b/core/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr @@ -9,14 +9,5 @@ if [ -n "$SLX_PVS_CONFIG_URL" ]; then [ -s "${DST}.new" ] && mv -f "${DST}.new" "${DST}" fi -# If this is a dedicated PVS station, make it launch right away -if [ -n "$SLX_PVS_DEDICATED" ] && cd /opt/openslx/xsessions; then - for file in *.desktop; do - cp -f "/usr/share/xsessions/pvs2mgr.desktop" "$file" - done - # patch autologin into kdmrc - sed -i '/AutoLogin.*=/d;/^\[X-.*-Core\]/a AutoLoginEnable=true\nAutoLoginUser=demo\nAutoLoginAgain=true\nAutoLoginDelay=0' "/etc/kde/kdm/kdmrc" -fi - exit 0 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 5ff03227..e044f415 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 @@ -2,20 +2,24 @@ # 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= -PVSMGR_XSESSION_FILE="pvs2mgr.desktop" -# the second directory should not be needed, but lets be compatible with the old crap...... -for DIR in "/usr/share/xsessions" "/opt/openslx/xsessions/"; do - if [ -f "${DIR}/${PVSMGR_XSESSION_FILE}" ]; then - # extract the exact command string - PVSMGR_SESSION_CMD="$(grep -E "^Exec=.*$" "${DIR}/${PVSMGR_XSESSION_FILE}" |cut -c 6-)" - break +if [ "$SESSION_TYPE" = "XSESSION" ]; then + # detect session command of the PVS-Manager session by looking at the xsession file + # TODO Maybe the vmchooser should just expose the session file's name/path, or we + # can define a new X-Property in the .desktop file that stops pvsclient from starting. + PVSMGR_SESSION_CMD= + PVSMGR_XSESSION_FILE="pvs2mgr.desktop" + # the second directory should not be needed, but lets be compatible with the old crap...... + for DIR in "/usr/share/xsessions" "/opt/openslx/xsessions/"; do + if [ -f "${DIR}/${PVSMGR_XSESSION_FILE}" ]; then + # extract the exact command string + PVSMGR_SESSION_CMD="$(grep -E "^Exec=.*$" "${DIR}/${PVSMGR_XSESSION_FILE}" |cut -c 6-)" + break + fi + done + 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 -done -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 -- cgit v1.2.3-55-g7522