Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1bac5f5

Browse files
committed
pg_ctl: Make failure to complete operation a nonzero exit
If an operation being waited for does not complete within the timeout,then exit with a nonzero exit status. This was previously handledinconsistently.
1 parentd80e73f commit1bac5f5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

‎doc/src/sgml/ref/pg_ctl-ref.sgml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,13 @@ PostgreSQL documentation
412412
<command>pg_ctl</command> returns an exit code based on the
413413
success of the startup or shutdown.
414414
</para>
415+
416+
<para>
417+
If the operation does not complete within the timeout (see
418+
option <option>-t</option>), then <command>pg_ctl</command> exits with
419+
a nonzero exit status. But note that the operation might continue in
420+
the background and eventually succeed.
421+
</para>
415422
</listitem>
416423
</varlistentry>
417424

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,9 @@ do_start(void)
840840
break;
841841
casePOSTMASTER_STILL_STARTING:
842842
print_msg(_(" stopped waiting\n"));
843-
print_msg(_("server is still starting up\n"));
843+
write_stderr(_("%s: server did not start in time\n"),
844+
progname);
845+
exit(1);
844846
break;
845847
casePOSTMASTER_FAILED:
846848
print_msg(_(" stopped waiting\n"));
@@ -1166,7 +1168,9 @@ do_promote(void)
11661168
else
11671169
{
11681170
print_msg(_(" stopped waiting\n"));
1169-
print_msg(_("server is still promoting\n"));
1171+
write_stderr(_("%s: server did not promote in time\n"),
1172+
progname);
1173+
exit(1);
11701174
}
11711175
}
11721176
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp