1

Im using postgresql 10.1 on Mac.

I have a trouble in terminating a background worker using SIGTERM. In my project, im creating a new background worker using RegisterBackgroundWorker(). i have included a test_function, as a signal handler for SIGTERM. No other signal handlers are defined.

pqsignal(SIGTERM, test_function)

when i issue pkill -15 postgres, i see that the handler is being called twice. Why does it happen? Am i missing anything??

1 Answers1

1

You should use PID of the postmaster instead of postgres because this will issue SIGTERM to all the process with that name which will include your BackgroundWorker 

kill postmaster-pid 

will do it.

Eduru
  • 151
  • 5