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

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Paul Guo <pguo(at)pivotal(dot)io>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [Patch] Create a new session in postmaster by calling setsid()
Date: 2018-09-12 19:46:39
Message-ID: 87musmo60w.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

>> The tricky part about doing setsid() is this: you're not allowed to
>> do it if you're already a process group leader. silent_mode worked
>> by having postmaster do another fork, exit in the parent, and do
>> setsid() in the child.

Tom> Hmph. Can't we just ignore that error?

If you ignore the error from setsid(), then you're still a process group
leader (as you would be after running setsid()), but you're still
attached to whatever controlling terminal (if any) you were previously
attached to.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-09-12 19:55:00 Re: [Patch] Create a new session in postmaster by calling setsid()
Previous Message Tom Lane 2018-09-12 19:41:39 Re: [Patch] Create a new session in postmaster by calling setsid()