# HG changeset patch
# User "mandrake (Geoff Harrison)" <mandrake@mandrake.net>
# Date 1200639790 -32400
# Node ID c01c9790d2b83f493a4aa5f86e1a5b1233d7daa2
# Parent  eaa43842608caf75552e9f755c91e35b7a2ff6d1
[ldirectord]: clear config in memory on reload
when re-reading a config file you're not actually killing the old config
information.  easy way to spot the symptom - move a node from one virtual
web pool to another.

root@lbtest-001:~# ipvsadm -L
IP Virtual Server version 1.2.1 (size=262144)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  172.18.100.120:www rr
  -> 192.168.0.201:www            Masq    1      0          0
  -> 192.168.0.202:www            Masq    1      0          0
TCP  172.18.100.121:www rr
  -> 192.168.0.200:www            Masq    1      0          0
TCP  172.18.100.120:mysql wrr
  -> 192.168.0.202:mysql          Masq    1      0          0
  -> 192.168.0.201:mysql          Masq    1      0          0
  -> 192.168.0.200:mysql          Masq    1      0          0
root@lbtest-001:~# /usr/sbin/ldirectord -d reload
DEBUG2: Running exec(/usr/sbin/ldirectord -d reload)
Running exec(/usr/sbin/ldirectord -d reload)
DEBUG2: Invoking ldirectord invoked as: /usr/sbin/ldirectord reload
Invoking ldirectord invoked as: /usr/sbin/ldirectord reload
DEBUG2: Exiting with exit_status 0: Exiting from ldirectord reload
Exiting with exit_status 0: Exiting from ldirectord reload
root@lbtest-001:~# ipvsadm -L
IP Virtual Server version 1.2.1 (size=262144)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  172.18.100.120:www rr
  -> 192.168.0.201:www            Masq    1      0          0
TCP  172.18.100.121:www rr
  -> 192.168.0.202:www            Masq    1      0          0
  -> 192.168.0.200:www            Masq    1      0          0
TCP  172.18.100.120:mysql wrr
  -> 192.168.0.202:mysql          Masq    1      0          0
  -> 192.168.0.201:mysql          Masq    1      0          0
  -> 192.168.0.200:mysql          Masq    1      0          0

this did not work previously.

CC: "mandrake (Geoff Harrison)" <mandrake@mandrake.net>
Signed-off-by: Simon Horman <horms@verge.net.au>

diff -r eaa43842608c -r c01c9790d2b8 ldirectord/ldirectord.in
--- a/ldirectord/ldirectord.in	Fri Jan 18 16:03:10 2008 +0900
+++ b/ldirectord/ldirectord.in	Fri Jan 18 16:03:10 2008 +0900
@@ -965,6 +965,7 @@ sub reread_config
 sub reread_config
 {
 	@OLDVIRTUAL = @VIRTUAL;
+	@VIRTUAL = ();
 	my %OLD_INSTANCE = %LD_INSTANCE;
 	my %RELOAD;
 	my %STOP;
