Re: [Patch] Create a new session in postmaster by calling setsid() - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: [Patch] Create a new session in postmaster by calling setsid()
Date
Msg-id 87musmo60w.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: [Patch] Create a new session in postmaster by calling setsid()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [Patch] Create a new session in postmaster by calling setsid()
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.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)


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [Patch] Create a new session in postmaster by calling setsid()
Next
From: Tom Lane
Date:
Subject: Re: [Patch] Create a new session in postmaster by calling setsid()