Re: [Patch] Create a new session in postmaster by calling setsid()
От | Heikki Linnakangas |
---|---|
Тема | Re: [Patch] Create a new session in postmaster by calling setsid() |
Дата | |
Msg-id | 48215103-75de-0500-a0d1-261757112400@iki.fi обсуждение исходный текст |
Ответ на | Re: [Patch] Create a new session in postmaster by calling setsid() (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [Patch] Create a new session in postmaster by calling setsid()
|
Список | pgsql-hackers |
On 28/12/2018 22:13, Tom Lane wrote: > Heikki Linnakangas <hlinnaka@iki.fi> writes: >> Another idea would be to call setsid() in pg_ctl, after forking >> postmaster, like in Paul's original patch. That solves 1. and 2. To >> still do 3., add a signal handler for SIGINT in pg_ctl, which forwards >> the SIGINT to the postmaster process. Thoughts on that? > > That seems like a nice idea. Here's a patch to implement that. Seems to work. There is a small window between launching postmaster and installing the signal handler, though, where CTRL-C on pg_ctl will not abort the server launch. I think that's acceptable. Looking at the existing docs in the "Starting the Database Server" section, and the pg_ctl reference page, I don't think we need to change anything. This is the same user-visible behavior as before, except for the case with a script like in Paul's original post. And that is almost a bug fix: the manual says that pg_ctl "will start the server in the background", and I think the new behavior matches that description better than the old one. Perhaps we should mention something about how CTRL-C will interrupt the server launch in "pg_ctl -w" mode, but that isn't new, either. I don't think we should backpatch this. We haven't heard any complaints about this until now, and it seems plausible, although unlikely, that someone might be relying on the current behavior. - Heikki
В списке pgsql-hackers по дате отправления: