pg_ctl start doesn't daemonize properly

From: "Dennis, Allan" <adennis(at)ciena(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: pg_ctl start doesn't daemonize properly
Date: 2007-10-12 15:49:06
Message-ID: A3BA2251DD85404FBBEF7478C29D8742932BDA@onmxm01.ciena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I am having problems getting pg_ctl to detach from the controlling
terminal so that it's a proper daemon. I am running
pg_ctl start -w -s -l $logfile within a script, which is invoked from an
automated test framework written in python. If the python process is
stopped by Ctrl-C, postgres dies. But the documentation for pg_ctl says
"pg_ctl encapsulates tasks such as redirecting log output and properly
detaching from the terminal and process group" and "if no log file is
chosen, the standard output of pg_ctl should be redirected to a file or
piped to another process such as a log rotating program like rotatelogs;
otherwise postgres will write its output to the controlling terminal
(from the background) and will not leave the shell's process group." I
think I am doing what is necessary here -- you can see that I am
specifying the logfile in the invocation. So why do all the postmaster
processes die when I Ctrl-C the python process? Is there any way to get
insight into what's happening here?

Allan

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Koczan 2007-10-12 19:00:10 separating data and logs
Previous Message Robert Gravsjö 2007-10-12 08:50:43 Re: permissions on system catalogs for non-superuser?