From cf7847445fc8b2ceeabca6ba089ac0ca6e9ee158 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 13 Mar 2011 23:41:07 +0000 Subject: [PATCH] Revert default behavior of vncserver (Xvnc will not automatically be killed whenever the WM exits), but also fix vncserver -fg such that it can be successfully backgrounded (vncserver -fg &) to achieve the same effect. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1_1@4359 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/vncserver | 9 +++------ unix/vncserver.man | 11 +++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/unix/vncserver b/unix/vncserver index 2ceb6d88..7fe93bd1 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -338,13 +338,10 @@ if (-e "/tmp/.X11-unix/X$displayNumber" || $ENV{VNCDESKTOP}= $desktopName; if ($opt{'-fg'}) { - system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1"); - if (kill 0, `cat $pidFile`) { - $opt{'-kill'} = ':'.$displayNumber; - &Kill(); - } + close(STDIN); + system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> " . "edString($desktopLog) . " 2>&1"); } else { - system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> " . "edString($desktopLog) . " 2>&1 &"); + system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1 &"); } exit; diff --git a/unix/vncserver.man b/unix/vncserver.man index 5127056e..c24225ae 100644 --- a/unix/vncserver.man +++ b/unix/vncserver.man @@ -1,4 +1,4 @@ -.TH vncserver 1 "15 Apr 2009" "TigerVNC" "Virtual Network Computing" +.TH vncserver 1 "13 Mar 2011" "TigerVNC" "Virtual Network Computing" .SH NAME vncserver \- start or stop a VNC server .SH SYNOPSIS @@ -108,11 +108,10 @@ 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. +Runs Xvnc as a foreground process. This has two effects: (1) The VNC server +can be aborted with CTRL-C, and (2) the VNC server will exit as soon as the +user logs out of the window manager in the VNC session. 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: -- 2.39.5