xenserver: Restart HA daemon after force-reload-kmod.
authorBen Pfaff <blp@nicira.com>
Wed, 29 Jun 2011 22:55:15 +0000 (15:55 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 28 Jul 2011 18:21:58 +0000 (11:21 -0700)
Otherwise its heartbeats start failing after the reload and the XenServer
reboots after a minute or so.

Thanks to Justin Pettit for figuring out that this was HA-related.

Bug #5706.
Reported-by: Henrik Amren <henrik@nicira.com>
xenserver/etc_init.d_openvswitch

index 3aacb57..64ad52c 100755 (executable)
@@ -437,6 +437,14 @@ function force_reload_kmod {
     start
 
     action "Restore interface configuration from $script" $script
+
+    # Restart the high-availability daemon if it is running.  Otherwise
+    # it loses its heartbeat and reboots the system after a few minutes.
+    if pidof xhad >/dev/null && test -e /etc/xensource/xhad.conf; then
+       PATH=$PATH:/opt/xensource/xha
+       action "Stopping HA daemon" ha_stop_daemon
+       action "Starting HA daemon" ha_start_daemon
+    fi
 }
 
 case "$1" in