From 7d6244fe1c11aa02bbeb3097129873b10e2a708c Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Sun, 3 Sep 2023 21:35:13 +1200 Subject: [PATCH] vncserver: more debug output for xstartup - Use "set -x" in generated xstartup. - Announce running xstartup in logs. --- builder/startup/deb/select-de.sh | 1 + unix/vncserver | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/builder/startup/deb/select-de.sh b/builder/startup/deb/select-de.sh index 4a02804..901e738 100755 --- a/builder/startup/deb/select-de.sh +++ b/builder/startup/deb/select-de.sh @@ -198,6 +198,7 @@ generate_xstartup() { cat <<-SCRIPT > "$xstartup_script" #!/bin/sh +set -x $de_cmd SCRIPT chmod +x "$xstartup_script" diff --git a/unix/vncserver b/unix/vncserver index cdf447b..531b185 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -669,9 +669,10 @@ sub RunXstartup { DetectAndExportDisplay(); $ENV{VNCDESKTOP}= $desktopName; + my $xstartupCmd = "{ echo 'Running $xstartupFile'; $xstartupFile; }"; if ($opt{'-fg'}) { if (! $skipxstartup) { - system("$xstartupFile >> " . quotedString($desktopLog) . " 2>&1"); + system("$xstartupCmd >> " . quotedString($desktopLog) . " 2>&1"); } if (IsXvncRunning()) { $opt{'-kill'} = ':'.$displayNumber; @@ -680,12 +681,12 @@ sub RunXstartup { } else { if ($opt{'-autokill'}) { if (! $skipxstartup) { - system("($xstartupFile; $0 -kill :$displayNumber) >> " + system("($xstartupCmd; $0 -kill :$displayNumber) >> " . quotedString($desktopLog) . " 2>&1 &"); } } else { if (! $skipxstartup) { - system("$xstartupFile >> " . quotedString($desktopLog) + system("$xstartupCmd >> " . quotedString($desktopLog) . " 2>&1 &"); } }