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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [Patch] Create a new session in postmaster by calling setsid()
Дата
Msg-id 15239.1536782100@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [Patch] Create a new session in postmaster by calling setsid()  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Ответы Re: [Patch] Create a new session in postmaster by calling setsid()  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>  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.

Oh, got it.  So actually, the setsid has to be done by what is/will be
the postmaster process.

Although pg_ctl could sneak it in between forking and execing, it seems
like it'd be cleaner to have the postmaster proper do it in response to
a switch that pg_ctl passes it.  That avoids depending on the fork/exec
separation, and makes the functionality available for other postmaster
startup mechanisms, and opens the possibility of delaying the detach
to the end of startup.

            regards, tom lane


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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: [Patch] Create a new session in postmaster by calling setsid()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PATCH: Update snowball stemmers