Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-04-16 Thread Robert Haas
On Mon, Feb 17, 2014 at 8:26 PM, Tom Lane t...@sss.pgh.pa.us wrote: Bruce Momjian br...@momjian.us writes: It certainly might be --- I have no idea. What surprised me is that we are relying solely on system() to block signals to pg_ctl-spawned servers. The question is whether that is

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-04-16 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Feb 17, 2014 at 8:26 PM, Tom Lane t...@sss.pgh.pa.us wrote: Alternatively, we could do what the comments in pg_ctl have long thought desirable, namely get rid of use of system() in favor of fork()/exec(). With that, pg_ctl could do a setsid()

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-04-16 Thread Robert Haas
On Wed, Apr 16, 2014 at 12:35 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Mon, Feb 17, 2014 at 8:26 PM, Tom Lane t...@sss.pgh.pa.us wrote: Alternatively, we could do what the comments in pg_ctl have long thought desirable, namely get rid of use of

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-25 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: Or we could wait to see if anybody reports this sort of behavior in a shell that won't be out of support before 9.4 gets out the door. We have a field report of this happening in the sh shell in Solaris 10.  Our staff has confirmed this.  In Solaris 10 they

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-25 Thread Tom Lane
Kevin Grittner kgri...@ymail.com writes: Tom Lane t...@sss.pgh.pa.us wrote: Or we could wait to see if anybody reports this sort of behavior in a shell that won't be out of support before 9.4 gets out the door. We have a field report of this happening in the sh shell in Solaris 10.  Our

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Bjorn Munch
On 14/02 14.57, Kevin Grittner wrote: We have had a case where a production cluster was accidentally shut down by a customer who used Ctrl+C in the same sh session in which they had (long before) run pg_ctl start.  We have only seen this in sh on Solaris.  Other shells on Solaris don't behave

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Bruce Momjian
On Mon, Feb 17, 2014 at 10:38:29AM +0100, Bjorn Munch wrote: On 14/02 14.57, Kevin Grittner wrote: We have had a case where a production cluster was accidentally shut down by a customer who used Ctrl+C in the same sh session in which they had (long before) run pg_ctl start.  We have only

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Bruce Momjian
On Mon, Feb 17, 2014 at 10:38:29AM +0100, Bjorn Munch wrote: On 14/02 14.57, Kevin Grittner wrote: We have had a case where a production cluster was accidentally shut down by a customer who used Ctrl+C in the same sh session in which they had (long before) run pg_ctl start.  We have only

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Mon, Feb 17, 2014 at 10:38:29AM +0100, Bjorn Munch wrote: What Solaris version, and what version of sh? sh on Solaris isn't necessarily the real bourne shell. In Solaris 11 it's actually ksh93. This was Solaris 9. Isn't that out of support by

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Bruce Momjian
On Mon, Feb 17, 2014 at 12:25:33PM -0500, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Mon, Feb 17, 2014 at 10:38:29AM +0100, Bjorn Munch wrote: What Solaris version, and what version of sh? sh on Solaris isn't necessarily the real bourne shell. In Solaris 11 it's actually

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Alvaro Herrera
Bruce Momjian wrote: FYI, this email post has a header line that causes all replies to go _only_ to the group email address: Mail-Followup-To: pgsql-hackers@postgresql.org I assume it is something related to the Oracle mail server or something configured by the email author. Most

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Bjorn Munch
On 17/02 12.25, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Mon, Feb 17, 2014 at 10:38:29AM +0100, Bjorn Munch wrote: What Solaris version, and what version of sh? sh on Solaris isn't necessarily the real bourne shell. In Solaris 11 it's actually ksh93. This was Solaris

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Bjorn Munch
On 17/02 14.54, Alvaro Herrera wrote: Bruce Momjian wrote: FYI, this email post has a header line that causes all replies to go _only_ to the group email address: Mail-Followup-To: pgsql-hackers@postgresql.org I assume it is something related to the Oracle mail server or

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-17 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: It certainly might be --- I have no idea. What surprised me is that we are relying solely on system() to block signals to pg_ctl-spawned servers. The question is whether that is sufficient and whether we should be doing more. I don't think we have to

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-15 Thread Hannu Krosing
On 02/15/2014 02:25 AM, Greg Stark wrote: On 14 Feb 2014 23:07, Tom Lane t...@sss.pgh.pa.us mailto:t...@sss.pgh.pa.us wrote: If this is, as it sounds to be, a Solaris shell bug, doesn't it affect other daemons too? This is simmering i never exactly followed but i think if the shell

[HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-14 Thread Kevin Grittner
We have had a case where a production cluster was accidentally shut down by a customer who used Ctrl+C in the same sh session in which they had (long before) run pg_ctl start.  We have only seen this in sh on Solaris.  Other shells on Solaris don't behave this way, nor does sh on tested versions

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-14 Thread Tom Lane
Kevin Grittner kgri...@ymail.com writes: What is surprising is that the postmaster doesn't set up its own process group when it is running as a daemon.  We probably don't want to change that when postgres is run directly from a command line for development or diagnostic purposes, but Noah

Re: [HACKERS] Ctrl+C from sh can shut down daemonized PostgreSQL cluster

2014-02-14 Thread Greg Stark
On 14 Feb 2014 23:07, Tom Lane t...@sss.pgh.pa.us wrote: If this is, as it sounds to be, a Solaris shell bug, doesn't it affect other daemons too? This is simmering i never exactly followed but i think if the shell doesn't support job control it's expected behaviour, not a bug. Only shells