diff options
author | DRC <dcommander@users.sourceforge.net> | 2011-03-03 10:42:14 +0000 |
---|---|---|
committer | DRC <dcommander@users.sourceforge.net> | 2011-03-03 10:42:14 +0000 |
commit | 8fb1191522cc8447a0b9e543056e4c395097e94f (patch) | |
tree | 831c039e98ada2337c771f0d0a69ec1b5377ca04 | |
parent | 4c6bd4c77046e6cdca6ee1324aea8c8f4aca68b4 (diff) | |
download | tigervnc-8fb1191522cc8447a0b9e543056e4c395097e94f.tar.gz tigervnc-8fb1191522cc8447a0b9e543056e4c395097e94f.zip |
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)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4315 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rwxr-xr-x | unix/vncserver | 13 | ||||
-rw-r--r-- | unix/vncserver.man | 9 |
2 files changed, 20 insertions, 2 deletions
diff --git a/unix/vncserver b/unix/vncserver index 41e56035..0fbed190 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -122,7 +122,7 @@ if ($fontPath eq "") { # 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 @@ if (-e "/tmp/.X11-unix/X$displayNumber" || } $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; @@ -527,6 +535,7 @@ sub Usage " [-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"); diff --git a/unix/vncserver.man b/unix/vncserver.man index 1c93107b..5127056e 100644 --- a/unix/vncserver.man +++ b/unix/vncserver.man @@ -14,6 +14,7 @@ vncserver \- start or stop a VNC server .IR format ] .RB [ \-fp .IR font-path ] +.RB [ \-fg ] .RI [ Xvnc-options... ] .br .BI "vncserver \-kill :" display# @@ -105,6 +106,14 @@ The 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 |