77 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
10- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.332 2009/02/23 09:28:49 heikki Exp $
10+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.333 2009/03/04 13:56:40 heikki Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -429,6 +429,7 @@ static bool InRedo = false;
429429/*
430430 * Flag set by interrupt handlers for later service in the redo loop.
431431 */
432+ static volatile sig_atomic_t got_SIGHUP = false;
432433static volatile sig_atomic_t shutdown_requested = false;
433434/*
434435 * Flag set when executing a restore command, to tell SIGTERM signal handler
@@ -5362,6 +5363,15 @@ StartupXLOG(void)
53625363}
53635364#endif
53645365
5366+ /*
5367+ * Check if we were requested to re-read config file.
5368+ */
5369+ if (got_SIGHUP )
5370+ {
5371+ got_SIGHUP = false;
5372+ ProcessConfigFile (PGC_SIGHUP );
5373+ }
5374+
53655375/*
53665376 * Check if we were requested to exit without finishing
53675377 * recovery.
@@ -7641,6 +7651,13 @@ startupproc_quickdie(SIGNAL_ARGS)
76417651}
76427652
76437653
7654+ /* SIGHUP: set flag to re-read config file at next convenient time */
7655+ static void
7656+ StartupProcSigHupHandler (SIGNAL_ARGS )
7657+ {
7658+ got_SIGHUP = true;
7659+ }
7660+
76447661/* SIGTERM: set flag to abort redo and exit */
76457662static void
76467663StartupProcShutdownHandler (SIGNAL_ARGS )
@@ -7667,8 +7684,8 @@ StartupProcessMain(void)
76677684/*
76687685 * Properly accept or ignore signals the postmaster might send us
76697686 */
7670- pqsignal (SIGHUP ,SIG_IGN );/*ignore config file updates */
7671- pqsignal (SIGINT ,SIG_IGN );/* ignore query cancel */
7687+ pqsignal (SIGHUP ,StartupProcSigHupHandler );/*reload config file */
7688+ pqsignal (SIGINT ,SIG_IGN );/* ignore query cancel */
76727689pqsignal (SIGTERM ,StartupProcShutdownHandler );/* request shutdown */
76737690pqsignal (SIGQUIT ,startupproc_quickdie );/* hard crash time */
76747691pqsignal (SIGALRM ,SIG_IGN );