Skip site navigation (1) Skip section navigation (2)

SVN Commit by dpage: r4233 - in trunk/pgadmin3/xtra/pgagent: . include

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4233 - in trunk/pgadmin3/xtra/pgagent: . include
Date: 2005-05-23 15:10:25
Message-ID: 200505231510.j4NFAPWF026891@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
Author: dpage
Date: 2005-05-23 16:10:25 +0100 (Mon, 23 May 2005)
New Revision: 4233

Modified:
   trunk/pgadmin3/xtra/pgagent/include/pgAgent.h
   trunk/pgadmin3/xtra/pgagent/misc.cpp
   trunk/pgadmin3/xtra/pgagent/pgAgent.cpp
   trunk/pgadmin3/xtra/pgagent/unix.cpp
Log:
Add option on *nix to prevent detaching from the controlling tty.

Modified: trunk/pgadmin3/xtra/pgagent/include/pgAgent.h
===================================================================
--- trunk/pgadmin3/xtra/pgagent/include/pgAgent.h	2005-05-23 08:43:57 UTC (rev 4232)
+++ trunk/pgadmin3/xtra/pgagent/include/pgAgent.h	2005-05-23 15:10:25 UTC (rev 4233)
@@ -26,6 +26,10 @@
 extern wxString serviceDBname;
 extern wxString backendPid;
 
+#ifndef _WIN32_
+extern bool runInForeground;
+#endif
+
 // Log levels
 enum
 {

Modified: trunk/pgadmin3/xtra/pgagent/misc.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/misc.cpp	2005-05-23 08:43:57 UTC (rev 4232)
+++ trunk/pgadmin3/xtra/pgagent/misc.cpp	2005-05-23 15:10:25 UTC (rev 4233)
@@ -69,6 +69,13 @@
                         minLogLevel = val;
                     break;
                 }
+#ifndef _WIN32_
+                case 'd':
+                {
+					runInForeground = true;
+                    break;
+                }
+#endif
             }
         }
         else

Modified: trunk/pgadmin3/xtra/pgagent/pgAgent.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/pgAgent.cpp	2005-05-23 08:43:57 UTC (rev 4232)
+++ trunk/pgadmin3/xtra/pgagent/pgAgent.cpp	2005-05-23 15:10:25 UTC (rev 4233)
@@ -22,6 +22,9 @@
 long shortWait=10;
 long minLogLevel=LOG_ERROR;
 
+#ifndef _WIN32_
+bool runInForeground = false;
+#endif
 
 int MainRestartLoop(DBconn *serviceConn)
 {

Modified: trunk/pgadmin3/xtra/pgagent/unix.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/unix.cpp	2005-05-23 08:43:57 UTC (rev 4232)
+++ trunk/pgadmin3/xtra/pgagent/unix.cpp	2005-05-23 15:10:25 UTC (rev 4233)
@@ -24,7 +24,8 @@
 
     wxPrintf(_("Usage:\n"));
     wxPrintf(fn->GetName() + _(" [options] <connect-string>\n"));
-    wxPrintf(_("options:\n"));
+    wxPrintf(_("options:\n"));
+	wxPrintf(_("-f run in the foreground (do not detach from the terminal)\n"));
     wxPrintf(_("-t <poll time interval in seconds (default 10)>\n"));
     wxPrintf(_("-r <retry period after connection abort in seconds (>=10, default 30)>\n"));
     wxPrintf(_("-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>\n"));
@@ -92,9 +93,10 @@
     argv++;
 
     setOptions(argc, argv);
+
+	if (!runInForeground);
+		daemonize();
 
-    daemonize();
-
     MainLoop();
 
     return 0;


pgadmin-hackers by date

Next:From: svnDate: 2005-05-23 15:12:09
Subject: SVN Commit by dpage: r4234 - trunk/pgadmin3/xtra/pgagent
Previous:From: Dave PageDate: 2005-05-23 14:31:13
Subject: Re: 1.2.2 testing ==> [PROBLEM]

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group