Re: [Patch] Create a new session in postmaster by calling setsid()

From: Paul Guo <pguo(at)pivotal(dot)io>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [Patch] Create a new session in postmaster by calling setsid()
Date: 2018-08-06 04:11:26
Message-ID: CAEET0ZFy74SA-mrYN4pG76zujg__H2UKeNN-8ETX4-gnj5uwhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 2, 2018 at 10:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Paul Guo <pguo(at)pivotal(dot)io> writes:
> > [ make the postmaster execute setsid() too ]
>
> I'm a bit skeptical of this proposal. Forcing the postmaster to
> dissociate from its controlling terminal is a good thing in some
> scenarios, but probably less good in others, and manual postmaster
> starts are probably mostly in the latter class.
>
> I wonder whether having "pg_ctl start" do a setsid() would accomplish
> the same result with less chance of breaking debugging usages.
>
> regards, tom lane
>

Yes, if considering the case of starting postmaster manually, we can not
create
a new session in postmaster, so pg_ctl seems to be a good place for setsid()
call. Attached a newer patch. Thanks.

Attachment Content-Type Size
0001-Create-a-new-session-for-postmaster-in-pg_ctl-by-cal.patch application/octet-stream 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2018-08-06 04:38:24 Re: TupleTableSlot abstraction
Previous Message Craig Ringer 2018-08-06 03:22:34 Allow postgres_fdw passwordless non-superuser conns with prior superuser permission