Revision: 4315
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4315&view=rev
Author:   dcommander
Date:     2011-03-03 10:42:14 +0000 (Thu, 03 Mar 2011)

Log Message:
-----------
Always exit Xvnc whenever the user exits the window manager, and provide a -fg 
switch to allow Xvnc to run in the foreground (necessary for some grid 
computing environments)

Modified Paths:
--------------
    trunk/unix/vncserver
    trunk/unix/vncserver.man

Modified: trunk/unix/vncserver
===================================================================
--- trunk/unix/vncserver        2011-03-03 09:55:21 UTC (rev 4314)
+++ trunk/unix/vncserver        2011-03-03 10:42:14 UTC (rev 4315)
@@ -122,7 +122,7 @@
 # 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'});
 
@@ -306,7 +306,15 @@
 }
 $ENV{VNCDESKTOP}= $desktopName;
 
-system("$vncUserDir/xstartup >> " . &quotedString($desktopLog) . " 2>&1 &");
+if ($opt{'-fg'}) {
+    system("$vncUserDir/xstartup >> " . &quotedString($desktopLog) . " 2>&1");
+    if (kill 0, `cat $pidFile`) {
+        $opt{'-kill'} = ':'.$displayNumber;
+        &Kill();
+    }
+} else {
+    system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> " . 
&quotedString($desktopLog) . " 2>&1 &");
+}
 
 exit;
 
@@ -527,6 +535,7 @@
        "                 [-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");

Modified: trunk/unix/vncserver.man
===================================================================
--- trunk/unix/vncserver.man    2011-03-03 09:55:21 UTC (rev 4314)
+++ trunk/unix/vncserver.man    2011-03-03 10:42:14 UTC (rev 4315)
@@ -14,6 +14,7 @@
 .IR format ]
 .RB [ \-fp
 .IR font-path ]
+.RB [ \-fg ]
 .RI [ Xvnc-options... ]
 .br
 .BI "vncserver \-kill :" display#
@@ -105,6 +106,14 @@
 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


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to