pgsql: Leave SIGTTIN/SIGTTOU signal handling alone in postmasterchild

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Leave SIGTTIN/SIGTTOU signal handling alone in postmasterchild
Дата
Msg-id E1gO8Bi-00076U-1N@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Fix some spurious new compiler warnings in MSVC.
Следующее
От: Tomas Vondra
Дата:
Сообщение: pgsql: Add valgrind suppressions for wcsrtombs optimizations