aboutsummaryrefslogtreecommitdiff
path: root/xenserver
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2010-09-10 14:20:49 -0700
committerJustin Pettit <jpettit@nicira.com>2010-09-10 14:20:49 -0700
commit29e21ea26944731f9b9681fecedc81cd5c86f342 (patch)
treed44b446a0049921cdc0d7830852bf135e40557c2 /xenserver
parent6784cb57cf432197c497764cdb01cecd68f10362 (diff)
xenserver: Don't monitor external-ids until XAPI is up
monitor-external-ids can't complete all its tasks until XAPI is up. The daemon is usually started before XAPI, so it can miss events. This commit causes the daemon to block until XAPI is finished initializing.
Diffstat (limited to 'xenserver')
-rwxr-xr-xxenserver/usr_share_openvswitch_scripts_monitor-external-ids7
1 files changed, 7 insertions, 0 deletions
diff --git a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids
index c87171f0..f91801d2 100755
--- a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids
+++ b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids
@@ -21,9 +21,11 @@
# Bridge table and duplicates its value to the preferred "xs-network-uuids".
import getopt
+import os
import subprocess
import sys
import syslog
+import time
import XenAPI
@@ -189,6 +191,11 @@ def main(argv):
idl = ovs.db.idl.Idl(remote, "Open_vSwitch", monitor_uuid_schema_cb)
ovs.daemon.daemonize()
+
+ # This daemon is usually started before XAPI, but to complete our
+ # tasks, we need it. Wait here until it's up.
+ while not os.path.exists("/var/run/xapi_init_complete.cookie"):
+ time.sleep(1)
bridges = {}
interfaces = {}