# Check command line options
&ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,
- "-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0);
+ "-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0);
&Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});
$ENV{VNCDESKTOP}= $desktopName;
if ($opt{'-fg'}) {
- close(STDIN);
- system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> " . "edString($desktopLog) . " 2>&1");
+ system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1");
+ if (kill 0, `cat $pidFile`) {
+ $opt{'-kill'} = ':'.$displayNumber;
+ &Kill();
+ }
} else {
- system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1 &");
+ if ($opt{'-autokill'}) {
+ system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> "
+ . "edString($desktopLog) . " 2>&1 &");
+ } else {
+ system("$vncUserDir/xstartup >> " . "edString($desktopLog)
+ . " 2>&1 &");
+ }
}
exit;
" [-pixelformat rgbNNN|bgrNNN]\n".
" [-fp <font-path>]\n".
" [-fg]\n".
+ " [-autokill]\n".
" <Xvnc-options>...\n\n".
" $prog -kill <X-display>\n\n".
" $prog -list\n\n");
.RB [ \-fp
.IR font-path ]
.RB [ \-fg ]
+.RB [ \-autokill ]
.RI [ Xvnc-options... ]
.br
.BI "vncserver \-kill :" display#
user logs out of the window manager in the VNC session. This may be necessary
when launching TigerVNC from within certain grid computing environments.
+.TP
+.B \-autokill
+Automatically kill Xvnc whenever the xstartup script exits. In most cases,
+this has the effect of terminating Xvnc when the user logs out of the window
+manager.
+
.SH FILES
Several VNC-related files are found in the directory $HOME/.vnc:
.TP