File tree 4 files changed +34
-12
lines changed
4 files changed +34
-12
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,9 @@ PostgreSQL documentation
118
118
119
119
<para>
120
120
In the absence of fatal errors, <application>pg_receivewal</application>
121
- will run until terminated by the <systemitem>SIGINT</systemitem> signal
122
- (<keycombo action="simul"><keycap>Control</keycap><keycap>C</keycap></keycombo>).
121
+ will run until terminated by the <systemitem>SIGINT</systemitem>
122
+ (<keycombo action="simul"><keycap>Control</keycap><keycap>C</keycap></keycombo>)
123
+ or <systemitem>SIGTERM</systemitem> signal.
123
124
</para>
124
125
</refsect1>
125
126
@@ -457,7 +458,8 @@ PostgreSQL documentation
457
458
458
459
<para>
459
460
<application>pg_receivewal</application> will exit with status 0 when
460
- terminated by the <systemitem>SIGINT</systemitem> signal. (That is the
461
+ terminated by the <systemitem>SIGINT</systemitem> or
462
+ <systemitem>SIGTERM</systemitem> signal. (That is the
461
463
normal way to end it. Hence it is not an error.) For fatal errors or
462
464
other signals, the exit status will be nonzero.
463
465
</para>
Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ PostgreSQL documentation
46
46
a slot without consuming it, use
47
47
<link linkend="functions-replication"><function>pg_logical_slot_peek_changes</function></link>.
48
48
</para>
49
+
50
+ <para>
51
+ In the absence of fatal errors, <application>pg_recvlogical</application>
52
+ will run until terminated by the <systemitem>SIGINT</systemitem>
53
+ (<keycombo action="simul"><keycap>Control</keycap><keycap>C</keycap></keycombo>)
54
+ or <systemitem>SIGTERM</systemitem> signal.
55
+ </para>
49
56
</refsect1>
50
57
51
58
<refsect1>
@@ -407,6 +414,17 @@ PostgreSQL documentation
407
414
</para>
408
415
</refsect1>
409
416
417
+ <refsect1>
418
+ <title>Exit Status</title>
419
+ <para>
420
+ <application>pg_recvlogical</application> will exit with status 0 when
421
+ terminated by the <systemitem>SIGINT</systemitem> or
422
+ <systemitem>SIGTERM</systemitem> signal. (That is the
423
+ normal way to end it. Hence it is not an error.) For fatal errors or
424
+ other signals, the exit status will be nonzero.
425
+ </para>
426
+ </refsect1>
427
+
410
428
<refsect1>
411
429
<title>Environment</title>
412
430
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ static int verbose = 0;
45
45
static int compresslevel = 0 ;
46
46
static int noloop = 0 ;
47
47
static int standby_message_timeout = 10 * 1000 ; /* 10 sec = default */
48
- static volatile bool time_to_stop = false;
48
+ static volatile sig_atomic_t time_to_stop = false;
49
49
static bool do_create_slot = false;
50
50
static bool slot_exists_ok = false;
51
51
static bool do_drop_slot = false;
@@ -673,13 +673,13 @@ StreamLog(void)
673
673
}
674
674
675
675
/*
676
- * When sigint is called , just tell the system to exit at the next possible
677
- * moment.
676
+ * When SIGINT/SIGTERM are caught , just tell the system to exit at the next
677
+ * possible moment.
678
678
*/
679
679
#ifndef WIN32
680
680
681
681
static void
682
- sigint_handler (int signum )
682
+ sigexit_handler (int signum )
683
683
{
684
684
time_to_stop = true;
685
685
}
@@ -905,7 +905,8 @@ main(int argc, char **argv)
905
905
* if one is needed, in GetConnection.)
906
906
*/
907
907
#ifndef WIN32
908
- pqsignal (SIGINT , sigint_handler );
908
+ pqsignal (SIGINT , sigexit_handler );
909
+ pqsignal (SIGTERM , sigexit_handler );
909
910
#endif
910
911
911
912
/*
Original file line number Diff line number Diff line change @@ -650,11 +650,11 @@ StreamLogicalLog(void)
650
650
#ifndef WIN32
651
651
652
652
/*
653
- * When sigint is called , just tell the system to exit at the next possible
654
- * moment.
653
+ * When SIGINT/SIGTERM are caught , just tell the system to exit at the next
654
+ * possible moment.
655
655
*/
656
656
static void
657
- sigint_handler (int signum )
657
+ sigexit_handler (int signum )
658
658
{
659
659
time_to_abort = true;
660
660
}
@@ -922,7 +922,8 @@ main(int argc, char **argv)
922
922
* if one is needed, in GetConnection.)
923
923
*/
924
924
#ifndef WIN32
925
- pqsignal (SIGINT , sigint_handler );
925
+ pqsignal (SIGINT , sigexit_handler );
926
+ pqsignal (SIGTERM , sigexit_handler );
926
927
pqsignal (SIGHUP , sighup_handler );
927
928
#endif
928
929
You can’t perform that action at this time.
0 commit comments