On Tue, Aug 16, 2022 at 7:26 PM Christoph Berg <m...@debian.org> wrote: > > Re: Bharath Rupireddy > > Don't we need a similar explanation [1] for pg_recvlogical docs? > > > > [1] > > <para> > > In the absence of fatal errors, <application>pg_receivewal</application> > > - will run until terminated by the <systemitem>SIGINT</systemitem> signal > > - (<keycombo > > action="simul"><keycap>Control</keycap><keycap>C</keycap></keycombo>). > > + will run until terminated by the <systemitem>SIGINT</systemitem> > > + (<keycombo > > action="simul"><keycap>Control</keycap><keycap>C</keycap></keycombo>) > > + or <systemitem>SIGTERM</systemitem> signal. > > Coped that from pg_receivewal(1) now.
Thanks. <application>pg_receivewal</application> will exit with status 0 when - terminated by the <systemitem>SIGINT</systemitem> signal. (That is the + terminated by the <systemitem>SIGINT</systemitem> or + <systemitem>SIGTERM</systemitem> signal. (That is the normal way to end it. Hence it is not an error.) For fatal errors or other signals, the exit status will be nonzero. Can we specify the reason in the docs why a SIGTERM causes (which typically would cause a program to end with non-zero exit code) pg_receivewal and pg_recvlogical exit with zero exit code? Having this in the commit message would help developers but the documentation will help users out there. Thoughts? [1] pg_receivewal, pg_recvlogical: Exit cleanly on SIGTERM In pg_receivewal, compressed output is only flushed on clean exits. The reason to support SIGTERM here as well is that pg_receivewal might well be running as a daemon, and systemd's default KillSignal is SIGTERM. Since pg_recvlogical is also supposed to run as a daemon, teach it about SIGTERM as well. -- Bharath Rupireddy RDS Open Source Databases: https://aws.amazon.com/rds/postgresql/