? .deps ? Makefile ? config.h ? config.log ? config.status ? pgpool_failover_command.patch ? stamp-h1 Index: main.c =================================================================== RCS file: /cvsroot/pgpool/pgpool/main.c,v retrieving revision 1.9 diff -c -r1.9 main.c *** main.c 9 Nov 2005 14:12:21 -0000 1.9 --- main.c 20 Nov 2005 06:06:24 -0000 *************** *** 786,792 **** pool_config.current_backend_port != pool_config.secondary_backend_port) { switching = 1; ! if (pool_config.replication_enabled) { replication = 1; --- 786,797 ---- pool_config.current_backend_port != pool_config.secondary_backend_port) { switching = 1; ! ! if (*pool_config.failover_command != '\0') ! { ! system(pool_config.failover_command); ! } ! if (pool_config.replication_enabled) { replication = 1; Index: pgpool.conf.sample =================================================================== RCS file: /cvsroot/pgpool/pgpool/pgpool.conf.sample,v retrieving revision 1.2 diff -c -r1.2 pgpool.conf.sample *** pgpool.conf.sample 25 Jun 2005 00:58:46 -0000 1.2 --- pgpool.conf.sample 20 Nov 2005 06:06:24 -0000 *************** *** 104,106 **** --- 104,109 ---- # data consistency. /*INSERT LOCK*/ comment has the same effect. # /NO INSERT LOCK*/ comment disables the effect. insert_lock = false + + # failover command + failover_command = 'wall "failover"' Index: pool.h =================================================================== RCS file: /cvsroot/pgpool/pgpool/pool.h,v retrieving revision 1.5 diff -c -r1.5 pool.h *** pool.h 22 Oct 2005 12:57:57 -0000 1.5 --- pool.h 20 Nov 2005 06:06:24 -0000 *************** *** 148,153 **** --- 148,154 ---- char *health_check_user; /* PostgreSQL user name for health check */ int insert_lock; /* if non 0, automatically lock table with INSERT to keep SERIAL data consistency */ + char *failover_command; /* failover command */ /* followings do not exist in the configuration file */ char *current_backend_host_name; /* current backend host name */ int current_backend_port; /* current backend port # */ Index: pool_config.l =================================================================== RCS file: /cvsroot/pgpool/pgpool/pool_config.l,v retrieving revision 1.4 diff -c -r1.4 pool_config.l *** pool_config.l 16 Aug 2005 13:42:19 -0000 1.4 --- pool_config.l 20 Nov 2005 06:06:24 -0000 *************** *** 135,140 **** --- 135,141 ---- pool_config.health_check_period = 0; pool_config.health_check_user = "nobody"; pool_config.insert_lock = 0; + pool_config.failover_command = ""; pool_config.num_servers = 0; #define PARSE_ERROR() pool_error("pool_config: parse error at line %d '%s'", Lineno, yytext) *************** *** 580,585 **** --- 581,604 ---- } pool_config.insert_lock = v; } + + else if (!strcmp(key, "failover_command")) + { + char *str; + + if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) + { + PARSE_ERROR(); + return(-1); + } + str = extract_string(yytext, token); + if (str == NULL) + { + return(-1); + } + pool_config.failover_command = str; + pool_debug("failover_command: %s", pool_config.failover_command); + } } if (pool_config.backend_port)