Re: Strange pg_ctl behavior: postmaster shuts down on shell interrupt - Mailing list pgsql-general

From Tom Lane
Subject Re: Strange pg_ctl behavior: postmaster shuts down on shell interrupt
Date
Msg-id 16809.1159649371@sss.pgh.pa.us
Whole thread Raw
In response to Strange pg_ctl behavior: postmaster shuts down on shell interrupt  ("smartdude" <in4tunio@gmail.com>)
List pgsql-general
"smartdude" <in4tunio@gmail.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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: alter integer field to serial integer primary key
Next
From: Tom Lane
Date:
Subject: Re: dropdb cmd line args