# 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);
+ "-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0);
&Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});
}
$ENV{VNCDESKTOP}= $desktopName;
-system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1 &");
+if ($opt{'-fg'}) {
+ system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1");
+ if (kill 0, `cat $pidFile`) {
+ $opt{'-kill'} = ':'.$displayNumber;
+ &Kill();
+ }
+} else {
+ system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> " . "edString($desktopLog) . " 2>&1 &");
+}
exit;
" [-geometry <width>x<height>]\n".
" [-pixelformat rgbNNN|bgrNNN]\n".
" [-fp <font-path>]\n".
+ " [-fg]\n".
" <Xvnc-options>...\n\n".
" $prog -kill <X-display>\n\n".
" $prog -list\n\n");
.IR format ]
.RB [ \-fp
.IR font-path ]
+.RB [ \-fg ]
.RI [ Xvnc-options... ]
.br
.BI "vncserver \-kill :" display#
argument allows you to override the above fallback logic and specify a font
path for Xvnc to use.
+.TP
+.B \-fg
+This version of vncserver will always launch Xvnc in such a way that, when the
+user exits the window manager in their VNC session, Xvnc will terminate.
+Specifying this option will additionally make Xvnc run as a foreground process,
+which means that it can be aborted with CTRL-C. This may be necessary when
+launching TigerVNC from within certain grid computing environments.
+
.SH FILES
Several VNC-related files are found in the directory $HOME/.vnc:
.TP