delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/12/12:42:37

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Authentication-Warning: shell-2.enteract.com: fcy set sender to fred AT ontosys DOT com using -f
Date: Thu, 12 Jul 2001 11:42:08 -0500
From: Fred Yankowski <fred AT ontosys DOT com>
To: cygwin AT cygwin DOT com
Cc: pgsql-cygwin AT postgresql DOT org
Subject: Re: [ANNOUNCEMENT] Updated: cygrunsrv-0.94-1
Message-ID: <20010712114208.A11408@enteract.com>
References: <20010712101949 DOT A96400 AT enteract DOT com> <20010712114538 DOT G453 AT dothill DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <20010712114538.G453@dothill.com>; from Jason.Tishler@dothill.com on Thu, Jul 12, 2001 at 11:45:39AM -0400

On Thu, Jul 12, 2001 at 11:45:39AM -0400, Jason Tishler wrote:
> Please post your patch -- I've been waiting with bated breath since you
> first mentioned it.  :,)  I will be quite willing to champion it (or a
> better solution, if one can be devised) for inclusion into PostgreSQL CVS.

OK, here's the patch.  It's crude, simply causing the SIGHUP handlers
(one for postmaster and one for postgres) to return immediately
without triggering the normal config-file-reloading response.

BTW, while testing this patch again after a 'cvs update' I notice that
I've got more 'postgres' processes running than usual.  In the idle
state I expect to have just one process named 'postgres' running; it's
actually the postmaster and has cygrunsrv as its parent.  But now I've
got two other postgres processes, one a child of the postmaster and
the other a child of the first.  I don't remember seeing this before.
I don't have any client programs running.  Stopping and restarting the
service results in the same situation.  Starting a client causes a new
postgres child process of the postmaster to run while the client is
connected, as usual.  I'm puzzled about those two other processes.

-- 
Fred Yankowski           fred AT OntoSys DOT com      tel: +1.630.879.1312
Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA

--

Index: src/backend/postmaster/postmaster.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/postmaster/postmaster.c,v
retrieving revision 1.229
diff -u -p -r1.229 postmaster.c
--- src/backend/postmaster/postmaster.c 2001/06/29 16:05:57     1.229
+++ src/backend/postmaster/postmaster.c 2001/07/12 16:34:29
@@ -1284,6 +1284,18 @@ SIGHUP_handler(SIGNAL_ARGS)
        int                     save_errno = errno;

        PG_SETMASK(&BlockSig);
+#ifdef __CYGWIN__
+       /*
+        * Ignore SIGHUP since Cygwin sends a SIGHUP when NT is being
+        * shut down.  Attempting to handle this signal as normal
+        * seems to block the concurrent activity to shutdown the
+        * postmaster.
+        */
+       if (DebugLvl)
+         postmaster_error("ignoring caught SIGHUP in postmaster");
+       errno = save_errno;
+       return;
+#endif

        if (Shutdown <= SmartShutdown)
        {
Index: src/backend/tcop/postgres.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/tcop/postgres.c,v
retrieving revision 1.227
diff -u -p -r1.227 postgres.c
--- src/backend/tcop/postgres.c 2001/06/29 16:05:56     1.227
+++ src/backend/tcop/postgres.c 2001/07/12 16:34:31
@@ -1022,6 +1022,10 @@ FloatExceptionHandler(SIGNAL_ARGS)
 static void
 SigHupHandler(SIGNAL_ARGS)
 {
+#ifdef __CYGWIN__
+       elog(DEBUG, "ignoring caught SIGHUP in postgres\n");
+       return;
+#endif
        got_SIGHUP = true;
 }

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019