diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index efc0729..3ddab6c 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -1602,13 +1602,20 @@ pgwin32_ServiceMain(DWORD argc, LPTSTR *argv) if (do_wait) { write_eventlog(EVENTLOG_INFORMATION_TYPE, _("Waiting for server startup...\n")); - if (test_postmaster_connection(postmasterPID, true) != PQPING_OK) + switch (test_postmaster_connection(postmasterPID, true)) { - write_eventlog(EVENTLOG_ERROR_TYPE, _("Timed out waiting for server startup\n")); - pgwin32_SetServiceStatus(SERVICE_STOPPED); - return; + case PQPING_OK: + write_eventlog(EVENTLOG_INFORMATION_TYPE, _("Server started and accepting connections\n")); + break; + case PQPING_REJECT: + write_eventlog(EVENTLOG_INFORMATION_TYPE, _("Server startup timed out but might continue in the background\n")); + break; + case PQPING_NO_RESPONSE: + case PQPING_NO_ATTEMPT: + write_eventlog(EVENTLOG_ERROR_TYPE, _("Server startup failed. Examine the log output.\n")); + pgwin32_SetServiceStatus(SERVICE_STOPPED); + return; } - write_eventlog(EVENTLOG_INFORMATION_TYPE, _("Server started and accepting connections\n")); } pgwin32_SetServiceStatus(SERVICE_RUNNING);