Re: [OT] Dilemma about OS <-> Postgres interaction

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [OT] Dilemma about OS <-> Postgres interaction
Date: 2004-06-19 11:32:17
Message-ID: 87f5e880f23f306d6524cd40c621790a@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> I should have mentioned that we need the messages sent very soon
> after they have landed in the 'inbox'; otherwise cron would
> definitely be the way to go -- including an @reboot line.

Cron will work just fine. Here's how I did it for a project I once
had. Write a perl script that make a connection to the database,
then loops indefinitely, checking the database every X seconds
for new mail to send. When in finds some, it forks a child to handle
it, then goes on listening. Now write a small script that checks if
the first script is still running. If it is, exit silently. If
not, launch a new instance. Add an entry in cron to run the second
script every minute. New mail is sent out instantly, and your script
gets resurrected if killed. You might also look into the daemontools
program, which does something similar.

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200406190730

-----BEGIN PGP SIGNATURE-----

iD8DBQFA1CS4vJuQZxSWSsgRArGzAJ0bgwn4RPYCNwz7xxzUE/wU1SOm/QCeMGBu
VyCS3Y4bNO8XySrH6slYsUM=
=O0Eb
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Heiserer 2004-06-19 12:26:08 administering files, data type "file"
Previous Message Tatsuo Ishii 2004-06-19 11:08:15 pgpool 2.0RC1