Re: [HACKERS] Shutting down server from a backend process, e.g. walrceiver

2010-09-22 Thread fazool mein
Thanks for the tips. In our case, SIGINT makes more sense. I'll use that. Regards On Tue, Sep 21, 2010 at 7:50 PM, Fujii Masao masao.fu...@gmail.com wrote: On Wed, Sep 22, 2010 at 2:50 AM, fazool mein fazoolm...@gmail.com wrote: Yes, I'll be modifying the code. In the walreceiver, I used

Re: [HACKERS] Shutting down server from a backend process, e.g. walrceiver

2010-09-21 Thread David Fetter
On Mon, Sep 20, 2010 at 05:48:40PM -0700, fazool mein wrote: Hi, I want to shut down the server under certain conditions that can be checked inside a backend process. For instance, while running symmetric Synchronous? replication, if the primary dies, I want the the walreceiver to

Re: [HACKERS] Shutting down server from a backend process, e.g. walrceiver

2010-09-21 Thread fazool mein
On Mon, Sep 20, 2010 at 9:44 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Sep 21, 2010 at 9:48 AM, fazool mein fazoolm...@gmail.com wrote: Hi, I want to shut down the server under certain conditions that can be checked inside a backend process. For instance, while running

Re: [HACKERS] Shutting down server from a backend process, e.g. walrceiver

2010-09-21 Thread fazool mein
On Tue, Sep 21, 2010 at 8:32 AM, David Fetter da...@fetter.org wrote: On Mon, Sep 20, 2010 at 05:48:40PM -0700, fazool mein wrote: Hi, I want to shut down the server under certain conditions that can be checked inside a backend process. For instance, while running symmetric

Re: [HACKERS] Shutting down server from a backend process, e.g. walrceiver

2010-09-21 Thread Fujii Masao
On Wed, Sep 22, 2010 at 2:50 AM, fazool mein fazoolm...@gmail.com wrote: Yes, I'll be modifying the code. In the walreceiver, I used the following to send a shutdown to the postmaster: kill(getppid(), SIGTERM); You can use the global variable PostmasterPid instead of getppid. There are three

[HACKERS] Shutting down server from a backend process, e.g. walrceiver

2010-09-20 Thread fazool mein
Hi, I want to shut down the server under certain conditions that can be checked inside a backend process. For instance, while running symmetric replication, if the primary dies, I want the the walreceiver to detect that and shutdown the standby. The reason for shutdown is that I want to execute

Re: [HACKERS] Shutting down server from a backend process, e.g. walrceiver

2010-09-20 Thread Fujii Masao
On Tue, Sep 21, 2010 at 9:48 AM, fazool mein fazoolm...@gmail.com wrote: Hi, I want to shut down the server under certain conditions that can be checked inside a backend process. For instance, while running symmetric replication, if the primary dies, I want the the walreceiver to detect that