vncserver: more debug output for xstartup

- Use "set -x" in generated xstartup.
- Announce running xstartup in logs.
This commit is contained in:
Dmitry Maksyoma 2023-09-03 21:35:13 +12:00
parent 21d2ae5018
commit 7d6244fe1c
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View File

@ -198,6 +198,7 @@ generate_xstartup() {
cat <<-SCRIPT > "$xstartup_script"
#!/bin/sh
set -x
$de_cmd
SCRIPT
chmod +x "$xstartup_script"

View File

@ -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 &");
}
}