aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 53278594722..5a050898fec 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -3973,7 +3973,11 @@ PostmasterStateMachine(void)
if (ReachedNormalRunning)
CancelBackup();
- /* Normal exit from the postmaster is here */
+ /*
+ * Normal exit from the postmaster is here. We don't need to log
+ * anything here, since the UnlinkLockFiles proc_exit callback
+ * will do so, and that should be the last user-visible action.
+ */
ExitPostmaster(0);
}
}
@@ -3985,9 +3989,21 @@ PostmasterStateMachine(void)
* startup process fails, because more than likely it will just fail again
* and we will keep trying forever.
*/
- if (pmState == PM_NO_CHILDREN &&
- (StartupStatus == STARTUP_CRASHED || !restart_after_crash))
- ExitPostmaster(1);
+ if (pmState == PM_NO_CHILDREN)
+ {
+ if (StartupStatus == STARTUP_CRASHED)
+ {
+ ereport(LOG,
+ (errmsg("shutting down due to startup process failure")));
+ ExitPostmaster(1);
+ }
+ if (!restart_after_crash)
+ {
+ ereport(LOG,
+ (errmsg("shutting down because restart_after_crash is off")));
+ ExitPostmaster(1);
+ }
+ }
/*
* If we need to recover from a crash, wait for all non-syslogger children
@@ -5439,8 +5455,7 @@ StartChildProcess(AuxProcType type)
MemoryContextDelete(PostmasterContext);
PostmasterContext = NULL;
- AuxiliaryProcessMain(ac, av);
- ExitPostmaster(0);
+ AuxiliaryProcessMain(ac, av); /* does not return */
}
#endif /* EXEC_BACKEND */