Обсуждение: pgsql: Kill pg_basebackup background process when exiting
Kill pg_basebackup background process when exiting If an error occurs in the foreground (backup) process of pg_basebackup, and we exit in a controlled way, the background process (streaming xlog process) would stay around and keep streaming. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/63ab2befe0d2332a5571f46c1a2c0af9447c6a4b Modified Files -------------- src/bin/pg_basebackup/pg_basebackup.c | 21 +++++++++++++++++++++ src/bin/pg_basebackup/pg_receivexlog.c | 7 +++++++ src/bin/pg_basebackup/streamutil.h | 6 ------ 3 files changed, 28 insertions(+), 6 deletions(-)
Hi Magnus, On 2014-02-12 17:46:48 +0000, Magnus Hagander wrote: > Kill pg_basebackup background process when exiting > > If an error occurs in the foreground (backup) process of pg_basebackup, > and we exit in a controlled way, the background process (streaming > xlog process) would stay around and keep streaming. It seems you need to add another include... http://pgbuildfarm.org/cgi-bin/show_log.pl?nm=nightjar&dt=2014-02-12%2018%3A37%3A37 /pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c: In function 'disconnect_and_exit': /pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:105: warning: implicit declaration of function'kill' /pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:105: error: 'SIGTERM' undeclared (first usein this function) /pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:105: error: (Each undeclared identifier isreported only once /pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:105: error: for each function it appears in.) that's #include <sys/types.h> #include <signal.h> Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
On Wed, Feb 12, 2014 at 7:47 PM, Andres Freund <andres@2ndquadrant.com> wrote:
It seems you need to add another include...
On 2014-02-12 17:46:48 +0000, Magnus Hagander wrote:
> Kill pg_basebackup background process when exiting
>
> If an error occurs in the foreground (backup) process of pg_basebackup,
> and we exit in a controlled way, the background process (streaming
> xlog process) would stay around and keep streaming.
http://pgbuildfarm.org/cgi-bin/show_log.pl?nm=nightjar&dt=2014-02-12%2018%3A37%3A37
/pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c: In function 'disconnect_and_exit':
/pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:105: warning: implicit declaration of function 'kill'
/pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:105: error: 'SIGTERM' undeclared (first use in this function)
/pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:105: error: (Each undeclared identifier is reported only once
/pgbuild/root/HEAD/pgsql.39771/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:105: error: for each function it appears in.)
Interesting, that worked on my test platforms. That said - thanks for pointing it out, will fix.
that's
#include <sys/types.h>
#include <signal.h>
sys/types.h was already included. That's probably why it worked on my linux. I'll add signal.h.
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/