Thread: PgAgent fail to connect on Windows startup
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi dave i found a problem with PgAgent under Windows, the service start before "Postgresql Database Server 8.2" and i have this message in Event Viewer Couldn't create connection: n'a pas pu se connecter au serveur : Connection refused (0x0000274D/10061)Le serveur est-il actifsur l'hôte « 127.0.0.1 »et accepte-t-il les connexions TCP/IP sur le port 5432 ? If i restart PgAgent manually, it works. When i open the "PgAgent Scheduling Agent" properties dialog, under Depends Tab, PgAgent Service don't have any depends How can i resolved this problem ? Regards, Christophe Chauvet. - -- Christophe Chauvet ( christophe_at_kryskool_dot_org ) Président d'Ornix ( http://ornix.org ) Association loi 1901 Promotion de Linux et des Logiciels Libres dans l'orne. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFGeS24Ml/S4ZhUIzERAqRxAJ9kHHui29oMbR0jBMaWyTsz5Lz/YQCg16qx y2LmbK4Wb3OnCCI7LlNv7Vc= =jkzT -----END PGP SIGNATURE-----
Christophe Chauvet wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi dave > > i found a problem with PgAgent under Windows, the service start before "Postgresql Database Server > 8.2" and i have this message in Event Viewer > > Couldn't create connection: n'a pas pu se connecter au serveur : Connection refused (0x0000274D/10061) > Le serveur est-il actif sur l'hôte « 127.0.0.1 » > et accepte-t-il les connexions TCP/IP sur le port 5432 ? > > If i restart PgAgent manually, it works. > > When i open the "PgAgent Scheduling Agent" properties dialog, under Depends Tab, PgAgent Service > don't have any depends > > How can i resolved this problem ? This is untested, but in theory... In regedit, assuming your pgAgent service ID is pgagent, add a REG_MULTI_SZ value called DependOnService under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pgagent Edit the value, and add the service ID of your local PostgreSQL installation, eg. pgsql-8.2 Restart... Regards Dave
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have tested your solution, it work (in theory) :), but i have this message in the event viewer, "Couldn't create connection: FATAL: the database system is starting up" How can we resolved this statement ? Regards, Christophe Chauvet Dave Page a écrit : > > > This is untested, but in theory... > > In regedit, assuming your pgAgent service ID is pgagent, add a > REG_MULTI_SZ value called DependOnService under: > > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pgagent > > Edit the value, and add the service ID of your local PostgreSQL > installation, eg. pgsql-8.2 > > Restart... > > Regards Dave - -- Christophe Chauvet ( christophe_at_kryskool_dot_org ) Président d'Ornix ( http://ornix.org ) Association loi 1901 Promotion de Linux et des Logiciels Libres dans l'orne. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFGeUW2Ml/S4ZhUIzERAuB7AKDMjAFZMSkieJRzdVzlQbgiAMKEewCgssnX smJMuO5ijpEZ4GJuqqUKGVY= =1nXM -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Dave The only solution i see to beat this problem is to add a delay before connect to the PostgreSQL Database with a new option (for exemple -d). options - -d <delay> Add delay (in second) before connect to the database. pgAgent INSTALL pgAgent -d 10 -u postgres .... What do you think about this ? Regards Christophe Chauvet. Christophe Chauvet a écrit : > I have tested your solution, it work (in theory) :), but i have this message in the event viewer, > > "Couldn't create connection: FATAL: the database system is starting up" > > How can we resolved this statement ? > > Regards, > > Christophe Chauvet > > Dave Page a écrit : > >> This is untested, but in theory... > >> In regedit, assuming your pgAgent service ID is pgagent, add a >> REG_MULTI_SZ value called DependOnService under: > >> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pgagent > >> Edit the value, and add the service ID of your local PostgreSQL >> installation, eg. pgsql-8.2 > >> Restart... > >> Regards Dave - ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster - -- Cordialement. Christophe Chauvet. - -- \|/// \ - - // ( @ @ ) **-------------------------oooO-(_)-Oooo------------------------** Christophe Chauvet mailto://christophe.chauvet@aznetwork.fr xmpp://christophe.chauvet@jabber.fr AZNetwork http://www.aznetwork.fr/ **--------------------------------Oooo--------------------------** oooO ( ) ( ) ) / \ ( (_/ \_) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFGf66rMl/S4ZhUIzERAhe6AJ4uNRD618wof3MKa6qn7k5qjjZg1ACg4VEw ezwCQQwpk299DhzZPh2EcT8= =6DES -----END PGP SIGNATURE-----
Christophe Chauvet wrote: > Hi Dave > > The only solution i see to beat this problem is to add a delay before connect to the PostgreSQL > Database with a new option (for exemple -d). > > options > -d <delay> Add delay (in second) before connect to the database. > > pgAgent INSTALL pgAgent -d 10 -u postgres .... > > What do you think about this ? I expect to fix the problem properly in PostgreSQL tomorrow - I'm just finishing off a patch to pg_ctl that implements the -w (wait) option in pg_ctl when run in service mode. This will ensure that it doesn't reportthe service as running until recovery has completedand connections are possible. Regards, Dave