Skip site navigation (1) Skip section navigation (2)

Re: pg_ctl start doesn't daemonize properly

From: "Dennis, Allan" <adennis(at)ciena(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_ctl start doesn't daemonize properly
Date: 2007-10-16 22:24:20
Message-ID: A3BA2251DD85404FBBEF7478C29D8742932EC0@onmxm01.ciena.com (view raw or flat)
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 figured out the problem, and record it here in hopes that it will help
others.

The silent_mode setting was not on, so postmaster initialization was not
calling setsid(), which is a necessary step to dissociate from the
controlling terminal (and thereby gain immunity from Ctrl-C on parent
processes). The logging setup I have (stdout logged to a specified
logfile and stderr redirected) seems to still work, despite the warnings
to the contrary in the config file template. I don't know why proper
daemonization is linked to being in "silent_mode", but... there you go.

Thanks for making the source code online, google-searchable, and
cross-referenced by doxygen -- I would have been stuck much longer
otherwise.

Allan

In response to

pgsql-admin by date

Next:From: Alexis BeuraudDate: 2007-10-17 09:05:22
Subject: running a SQL command at startup time
Previous:From: Martial Elise KIBADate: 2007-10-16 19:57:07
Subject: Re: Distributed DataBases

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group