fork() and dynamically loaded c functions....

From: Jay Flattery <jaycode(at)rocketmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: fork() and dynamically loaded c functions....
Date: 2010-08-10 18:42:58
Message-ID: 722420.36413.qm@web120110.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

I have some functions written in C that are dynamically loaded. I persist some
state between function calls, initialised by _PG_init. This works fine

I now fork() a process in _PG_Init() (both processes interact), but when I
shutdown postgre I get: LOG: failed to find proc 0x1331110 in ProcArray
Basically the child process stays alive after postgre exists (as verified by ps
-A)

I was thinking that I could use _PG_fini for the cleanup, but the manual says
that it "will only be called during an unload of the file, not during process
termination."

Is there any way to either a) insert some cleanup code when the server shuts
down; or b) instruct postgres to kill the child process?

Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vibhor Kumar 2010-08-10 20:02:18 Re: pgtune
Previous Message Jacqui Caren-home 2010-08-10 17:56:15 Re: MySQL versus Postgres