diff options
author | Christian Rößler | 2019-03-04 17:27:33 +0100 |
---|---|---|
committer | Christian Rößler | 2019-03-04 17:27:33 +0100 |
commit | f82429b7576f4698e9adbfccfad4a3d27f9cfdb6 (patch) | |
tree | f87c80d9d7260e3fd3ed9970f06b308bfb7f4171 /core | |
parent | [run-virt] openslx.exe: Fix timer races, remove dead code (diff) | |
download | mltk-f82429b7576f4698e9adbfccfad4a3d27f9cfdb6.tar.gz mltk-f82429b7576f4698e9adbfccfad4a3d27f9cfdb6.tar.xz mltk-f82429b7576f4698e9adbfccfad4a3d27f9cfdb6.zip |
[run-virt] Ugly fix for linux script / runscript root/user, default changed to user.
Diffstat (limited to 'core')
-rwxr-xr-x | core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc index cd17bd3b..2b291dfc 100755 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc @@ -15,17 +15,18 @@ function runscript() logger "openslx utility: runscript: Script extension empty or \'bat\', trying anyway." if [ -f "$DISKMOUNTDIR/runscript${SCRIPTEXT}" ]; then logger "openslx utility: runscript: found script $DISKMOUNTDIR/runscript${SCRIPTEXT}." + logger "openslx utility: runscript: script options: scriptuser: ${SCRIPTUSER}, scriptvisibility: ${SCRIPTVISIBILITY}." case "$SCRIPTUSER" in 0) USERPART="" ;; 1) USERPART=" su -c - $LOCALUSER " ;; - *) logger "openslx utility: runscript: Unknown script user or script user not set. Running as root." - USERPART="" + *) logger "openslx utility: runscript: Unknown script user or script user not set. Running as user ${LOCALUSER}." + # USERPART="" # old default: Running as root + USERPART=" su -c - $LOCALUSER " ;; esac - case "$SCRIPTVISIBILITY" in 0) # 0=hidden logger "openslx utility: runscript: Starting script hidden." @@ -36,7 +37,11 @@ function runscript() logger "openslx utility: runscript: Starting script maximised." get_xauthfile wait_for_wm - DISPLAY=:0.0 XAUTHORITY="${XAUTHORITY}" $USERPART "xterm $DISKMOUNTDIR/runscript${SCRIPTEXT}" & + if [ -n "$USERPART" ]; then + DISPLAY=:0.0 XAUTHORITY="${XAUTHORITY}" $USERPART "xterm $DISKMOUNTDIR/runscript${SCRIPTEXT}" & + else + DISPLAY=:0.0 XAUTHORITY="${XAUTHORITY}" $USERPART xterm "$DISKMOUNTDIR/runscript${SCRIPTEXT}" & + fi ;; 2) # 2=minimized (xterm -iconic) logger "openslx utility: runscript: starting script minimised." @@ -46,7 +51,11 @@ function runscript() # Truly not the best way to wait until the desktop environment is ready, but there's no common way to # check for DE readiness. Until then, we'll sleep. sleep 20 - DISPLAY=:0.0 XAUTHORITY="${XAUTHORITY}" $USERPART "xterm -iconic $DISKMOUNTDIR/runscript${SCRIPTEXT}" & + if [ -n "$USERPART" ]; then + DISPLAY=:0.0 XAUTHORITY="${XAUTHORITY}" $USERPART "xterm -iconic $DISKMOUNTDIR/runscript${SCRIPTEXT}" & + else + DISPLAY=:0.0 XAUTHORITY="${XAUTHORITY}" $USERPART xterm -iconic "$DISKMOUNTDIR/runscript${SCRIPTEXT}" & + fi ;; *) # *=? logger "openslx utility: runscript: unkown scriptVisibility $SCRIPTVISIBILITY." |