From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Leave SIGTTIN/SIGTTOU signal handling alone in postmaster child
Date: Sat, 17 Nov 2018 21:31:34 +0000
Message-ID: <E1gO8Bi-00076U-1N@gemulon.postgresql.org> (raw)
Leave SIGTTIN/SIGTTOU signal handling alone in postmaster child processes.
For reasons lost in the mists of time, most postmaster child processes
reset SIGTTIN/SIGTTOU signal handling to SIG_DFL, with the major exception
that backend sessions do not. It seems like a pretty bad idea for any
postmaster children to do that: if stderr is connected to the terminal,
and the user has put the postmaster in background, any log output would
result in the child process freezing up. Hence, switch them all to
doing what backends do, ie, nothing. This allows them to inherit the
postmaster's SIG_IGN setting. On the other hand, manually-launched
processes such as standalone backends will have default processing,
which seems fine.
In passing, also remove useless resets of SIGCONT and SIGWINCH signal
processing. Perhaps the postmaster once changed those to something
besides SIG_DFL, but it doesn't now, so these are just wasted (and
confusing) syscalls.
Basically, this propagates the changes made in commit 8e2998d8a from
backends to other postmaster children. Probably the only reason these
calls now exist elsewhere is that I missed changing pgstat.c along with
postgres.c at the time.
Given the lack of field complaints that can be traced to this, I don't
presently feel a need to back-patch.
Discussion: https://postgr.es/m/5627.1542477392@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/125f551c8be101ec36ec5fed5befc8fbf7370e0a
Modified Files
--------------
src/backend/postmaster/bgwriter.c | 4 ----
src/backend/postmaster/checkpointer.c | 4 ----
src/backend/postmaster/pgarch.c | 5 +----
src/backend/postmaster/pgstat.c | 5 +----
src/backend/postmaster/postmaster.c | 9 +++++++++
src/backend/postmaster/startup.c | 4 ----
src/backend/postmaster/syslogger.c | 4 ----
src/backend/postmaster/walwriter.c | 4 ----
src/backend/replication/walreceiver.c | 4 ----
src/backend/replication/walsender.c | 4 ----
10 files changed, 11 insertions(+), 36 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Leave SIGTTIN/SIGTTOU signal handling alone in postmaster child
In-Reply-To: <E1gO8Bi-00076U-1N@gemulon.postgresql.org>
References: <E1gO8Bi-00076U-1N@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox