summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data
diff options
context:
space:
mode:
authorSimon Rettberg2023-06-05 16:19:00 +0200
committerSimon Rettberg2023-06-05 16:19:00 +0200
commite63b2d5262a0c02d290fbedda2d8bd798830b115 (patch)
tree0d52d0c380777544219247b000f8ba48159bd0ce /core/modules/run-virt/data
parent[printergui] Log error via writelog instead of slxlog (diff)
downloadmltk-e63b2d5262a0c02d290fbedda2d8bd798830b115.tar.gz
mltk-e63b2d5262a0c02d290fbedda2d8bd798830b115.tar.xz
mltk-e63b2d5262a0c02d290fbedda2d8bd798830b115.zip
[run-virt] Start fspanel after WM, refine traps in subshell
Diffstat (limited to 'core/modules/run-virt/data')
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc22
1 files changed, 14 insertions, 8 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
index 2fa77cf8..d283d010 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
@@ -32,12 +32,6 @@ start_wm() {
return 1
fi
- # run very simple taskbar in case user minimizes VM somehow and doesn't know Alt+Tab
- if [ -z "$RUNVIRT_TASKBAR_PID" ] || ! kill -0 "$RUNVIRT_TASKBAR_PID"; then
- fspanel &
- declare -g RUNVIRT_TASKBAR_PID="$!"
- fi
-
# If it's the same, do nothing
if ! is_wm_running "${dm}"; then
# start DM determined above
@@ -62,7 +56,10 @@ start_wm() {
writelog "Starting ${dm} ${OPTS[*]}."
declare -g RUNVIRT_DM="${dm}"
{
- trap '[ -n "$wpid" ] && kill "$wpid"; exit' EXIT TERM INT
+ trap '' HUP
+ trap '[ -n "$wpid" ] && kill "$wpid"' EXIT
+ trap '[ -n "$wpid" ] && kill "$wpid"; exit 5' INT
+ trap '[ -n "$wpid" ] && kill "$wpid"; exit 6' TERM
dc=0
while true; do
s="$( date +%s )"
@@ -74,12 +71,15 @@ start_wm() {
e="$( date +%s )"
duration="$(( e - s ))"
case "$ret" in
- 0|129|130|143) exit 0 ;;
+ 0|129|130|143)
+ writelog "WM exited normally"
+ exit 0 ;;
esac
if [ "$duration" -ge 3 ]; then
dc=0
elif [ "$(( dc++ ))" -gt 5 ]; then
notify_user "$RUNVIRT_DM crasht immer wieder."
+ writelog "$RUNVIRT_DM keeps crashing"
exit 1
fi
done
@@ -87,6 +87,12 @@ start_wm() {
declare -g RUNVIRT_DM_PID="$!"
fi
+ # run very simple taskbar in case user minimizes VM somehow and doesn't know Alt+Tab
+ if [ -z "$RUNVIRT_TASKBAR_PID" ] || ! kill -0 "$RUNVIRT_TASKBAR_PID"; then
+ ( sleep 1; exec fspanel ) &
+ declare -g RUNVIRT_TASKBAR_PID="$!"
+ fi
+
if isempty HAVE_WM_CLEANUP_HOOK; then
add_cleanup stop_wm
declare -rg HAVE_WM_CLEANUP_HOOK=yes