summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2009-06-09 11:02:24 -0500
committerDavid Teigland <teigland@redhat.com>2009-06-09 11:02:24 -0500
commit7abbf712cea4f1bb6da0588f05b6f2dea45186cd (patch)
tree995230c71fbac5e6b45ff3c3aad289225d74f170
parent5ec1391ac616458db01fae1188fdbc1ba130cabc (diff)
downloaddct-stuff-7abbf712cea4f1bb6da0588f05b6f2dea45186cd.tar.gz
dct-stuff-7abbf712cea4f1bb6da0588f05b6f2dea45186cd.tar.xz
dct-stuff-7abbf712cea4f1bb6da0588f05b6f2dea45186cd.zip
cpgx: munge restart messages
Signed-off-by: David Teigland <teigland@redhat.com>
-rw-r--r--cpgx/cpgx.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/cpgx/cpgx.c b/cpgx/cpgx.c
index c2555ad..3681b08 100644
--- a/cpgx/cpgx.c
+++ b/cpgx/cpgx.c
@@ -1502,34 +1502,37 @@ int iterations_done(void)
void restart_cluster(void)
{
- syslog(LOG_WARNING, "%ld killing %s", time(NULL), exec_name);
- log_debug("killing %s", exec_name);
+ if (exec_addr[0]) {
+ log_debug("%s", iptables_a);
+ system(iptables_a);
+ }
- system(iptables_a);
+ log_debug("killing %s %s", exec_name, exec_addr);
+ syslog(LOG_WARNING, "%ld killing %s %s", time(NULL), exec_name, exec_addr);
if (exec_name[0] == 'a')
system("killall -9 aisexec");
else
system("killall -9 corosync");
+ /* corosync-cfgtool -H would be better if it can work, to avoid ipc leaks */
/* others should see us fail before we rejoin, not sure 10s will
be enough for some people */
sleep(restart_sec);
- system(iptables_d);
+ if (exec_addr[0]) {
+ log_debug("%s", iptables_d);
+ system(iptables_d);
+ }
- syslog(LOG_WARNING, "%ld starting %s", time(NULL), exec_name);
- log_debug("starting %s", exec_name);
+ log_debug("starting %s %s", exec_name, exec_addr);
+ syslog(LOG_WARNING, "%ld starting %s %s", time(NULL), exec_name, exec_addr);
- if (!exec_join) {
+ if (!exec_join)
system("cman_tool join -w");
- } else {
- if (exec_name[0] == 'a')
- system("aisexec");
- else
- system("corosync");
- }
+ else
+ system(exec_name);
}
void loop(void)