2e15b699069d147795f3b4bcdf50aa9d099be9ff
max
  Thu Mar 6 02:31:47 2014 -0800
moving the phoneHome business into cgiApoptosis.c/.h to make it callablefrom cart.c. We need to call it from cart.c as otherwise
cgiApoptosisSetup (originally: phoneHome) will be called after mysql
connections are opened. This leads to "mysql server has gone away" if
any CGI is not faster than the child process forked here. The child will
close all mysql connections of the parent process. With the new setup,
the childi is forked before any mysql connections are opened. Ideally
this would be all done in cheapcgi, but cheapcgi is not in the hg/lib
part of the code.

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index cff33bc..2cef778 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -3224,30 +3224,38 @@
 boolean hIsPrivateHost()
 /* Return TRUE if this is running on private (development) web-server.
  * This was originally genome-test as well as hgwdev, however genome-test
  * may be repurposed to direct users to the preview site instead of development site. */
 {
 return hHostHasPrefix("hgwdev") || hHostHasPrefix("genome-test");  // FIXME: If genome-test
 }
 
 boolean hIsBetaHost()
 /* Return TRUE if this is running on beta (QA) web-server.
  * Use sparingly as behavior on beta should be as close to RR as possible. */
 {
 return hHostHasPrefix("hgwbeta");
 }
 
+boolean hIsBrowserbox()
+/* Return TRUE if this is the browserbox virtual machine */
+{
+char name[256];
+gethostname(name, sizeof(name));
+return (startsWith("browserbox", name));
+}
+
 boolean hIsPreviewHost()
 /* Return TRUE if this is running on preview web-server.  The preview
  * server is a mirror of the development server provided for public
  * early access. */
 {
 if (cfgOption("test.preview"))
     return TRUE;
 return hHostHasPrefix("genome-preview");
 }
 
 char *hBrowserName()
 /* Return browser name based on host name */
 {
 return (hIsPreviewHost() ? "Preview Genome Browser" :
         (hIsPrivateHost() ? "TEST Genome Browser" : "Genome Browser"));