Strange pg_ctl behavior: postmaster shuts down on shell interrupt

Поиск
Список
Период
Сортировка
От smartdude
Тема Strange pg_ctl behavior: postmaster shuts down on shell interrupt
Дата
Msg-id 1159423924.390447.275280@e3g2000cwe.googlegroups.com
обсуждение исходный текст
Ответы Re: Strange pg_ctl behavior: postmaster shuts down on shell interrupt
Список pgsql-general
Hi all

We use postgres 8.0.4 for our application on Linux ES3 kernel 2.4.21-4.
We wrote a small shell script for starting postgres, which does little
more than just calling postmaster. We trap interrupt signal in the
shell script to allow postgres to start even if interrupted by the
user. But the trap does not seem to work with postmaster or pg_ctl -
that is, the process shuts down.

#pg_cant_trap.sh
#!/bin/sh
pg_ctl stop && sleep 10 #to stop any earlier instance
trap 'printf "trapped\n"' 2 3
pg_ctl start
pg_ctl status
sleep 10 #interrupt the script at this point
sleep 10
pg_ctl status

Interrupting the script at the mentioned point stops the postmaster.
This behavior is not seen if I replace postmaster by some of my own
shell script or a program, that is it does not stop.

A small thing, but I am interested in knowing how it is possible for
postmaster to behave in this way.


В списке pgsql-general по дате отправления:

Предыдущее
От: "Marshall"
Дата:
Сообщение: Re: cyclical redundancy checksum algorithm(s)?
Следующее
От: "David Cressey"
Дата:
Сообщение: Re: cyclical redundancy checksum algorithm(s)?