From b8b99aabf612d4fcfc452176c5da17ca623cc6a1 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 13 Feb 2025 10:24:44 -0500 Subject: [PATCH] vncserver: Add -test option to print Xvnc cmd line This is useful in conjunction with gdb or valgrind. Closes #448 --- unix/vncserver.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unix/vncserver.in b/unix/vncserver.in index 4c379aca6..da8c587d5 100644 --- a/unix/vncserver.in +++ b/unix/vncserver.in @@ -211,7 +211,7 @@ foreach $_registrydir (@registrydirs) { "-x509key", 1, "-autokill", 0, "-quiet", 0, "-wm", 1, "-sessionlist", 0, "-sessionstart", 0, "-novnc", 1, "-noautokill", 0, "-rfbport", 1, "-rfbunixpath", 1, "-uds", 0, - "-userdbus", 0); + "-userdbus", 0, "-test", 0); &Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'}); @@ -486,6 +486,10 @@ if (!$opt{'-debug'}) { # Run $cmd and record the process ID. $pidFile = "$vncUserDir/$host:$displayNumber.pid"; +if ($opt{'-test'}) { + print "$cmd\n"; + exit; +} system("$cmd & echo \$! >$pidFile"); # Record the RFB Unix domain socket path