Обсуждение: Listen and do something daemon

Поиск
Список
Период
Сортировка

Listen and do something daemon

От
KM
Дата:
Does this program already exist?

   $ listen-and-do --database=foo --listen-for="somenotification" \
      --then-do="some-script"

It will daemonize itself, issue a 'LISTEN somenotification' on the
database foo, and on each NOTIFY will run some-script.

Thanks
--
KM

Re: Listen and do something daemon

От
Josh Kupershmidt
Дата:
On Fri, Sep 24, 2010 at 9:42 PM, KM <km@xacrasis.netx> wrote:
> Does this program already exist?
>
>   $ listen-and-do --database=foo --listen-for="somenotification" \
>      --then-do="some-script"
>
> It will daemonize itself, issue a 'LISTEN somenotification' on the
> database foo, and on each NOTIFY will run some-script.

I think the "libpq Example Program 2" could be very easily adapted for this:
http://www.postgresql.org/docs/current/static/libpq-example.html

Josh