2

When my windows server 2008 start, both services postgres and pgAgent start because they are automatic.

enter image description here

But if my db is frozen and I need to restart the postgres service, the pgAgent is also stoped, but when postgres restart, pgAgent doesn't. So I have to restart pgAgent manually.

Is there a way to link pgAgent, so that it starts whenever postgresql starts?

PD: If someone knows a proper tag for windows services please add it, I couldn't find it.

  • Searching "win start multi services". I am using batch file instead of using service. From the question above, batch file contains : line 1: pg_ctl.exe start -D line 2: your_data & pgagent.exe ...... – Luan Huynh May 12 '16 at 3:36
1

If you want to try a different job agent rather than PGAgent, I wrote an alternative that takes care of this issue. It will stay running once your database goes down, and reconnect once it comes back up.

It's called jpgAgent: https://github.com/Tostino/jpgAgent

It also has quite a few more features, and has been much more stable for me over the past few months I've been using it in production.

Any questions, feel free to ask.

-Adam

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.