Re: Strange pg_ctl behavior: postmaster shuts down on shell interrupt

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "smartdude" <in4tunio(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange pg_ctl behavior: postmaster shuts down on shell interrupt
Date: 2006-09-30 20:49:31
Message-ID: 16809.1159649371@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"smartdude" <in4tunio(at)gmail(dot)com> writes:
> We use postgres 8.0.4 for our application on Linux ES3 kernel 2.4.21-4.
> We wrote a small shell script for starting postgres, which does little
> more than just calling postmaster. We trap interrupt signal in the
> shell script to allow postgres to start even if interrupted by the
> user.

"trap" only sets the shell's response to signals, not that of programs
started by the shell. You're going at this entirely the wrong way:
what you need is to make sure the postmaster is dissociated from your
terminal so it doesn't get signals from the keyboard in the first place.
I believe what you need to add is a "-l logfile" option to the pg_ctl
call so that the postmaster's stdout gets disconnected from the
terminal.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-09-30 20:52:33 Re: dropdb cmd line args
Previous Message Adrian Klaver 2006-09-30 20:49:08 Re: alter integer field to serial integer primary key