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.