OSDN Git Service

On systems that have setsid(2) (which should be just about everything except
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Nov 2006 20:59:53 +0000 (20:59 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Nov 2006 20:59:53 +0000 (20:59 +0000)
commit3ad0728c817bf8abd2c76bd11d856967509b307c
treeffaf56c059f678d2b41390027b8b9b973660cb7c
parentde597154a8acae01be28ba32b5b6e0ec4915ef3f
On systems that have setsid(2) (which should be just about everything except
Windows), arrange for each postmaster child process to be its own process
group leader, and deliver signals SIGINT, SIGTERM, SIGQUIT to the whole
process group not only the direct child process.  This provides saner behavior
for archive and recovery scripts; in particular, it's possible to shut down a
warm-standby recovery server using "pg_ctl stop -m immediate", since delivery
of SIGQUIT to the startup subprocess will result in killing the waiting
recovery_command.  Also, this makes Query Cancel and statement_timeout apply
to scripts being run from backends via system().  (There is no support in the
core backend for that, but it's widely done using untrusted PLs.)  Per gripe
from Stephen Harris and subsequent discussion.
src/backend/access/transam/xlog.c
src/backend/bootstrap/bootstrap.c
src/backend/postmaster/autovacuum.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/pgarch.c
src/backend/postmaster/pgstat.c
src/backend/postmaster/postmaster.c
src/backend/postmaster/syslogger.c
src/backend/storage/lmgr/proc.c
src/backend/tcop/postgres.c
src/backend/utils/adt/misc.c