summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2010-09-22 12:40:39 -0700
committerEthan Jackson <ethan@nicira.com>2010-09-22 20:06:40 -0700
commit998bb652ecb494af8aa38ed0ae4e653cd8dff709 (patch)
treed61429c09804c2063829762b2e6fd7935fcbbe5b /python
parent0d8568c13e6cfd34e0da977279f93beb26e33968 (diff)
downloadopenvswitch-998bb652ecb494af8aa38ed0ae4e653cd8dff709.tar.gz
xenserver: monitor-external-ids should run with --monitor
The init script starts monitor-external-ids with --monitor when configured to do so. Also made changes to guarantee that --monitor actually restarts ovs-external-ids. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'python')
-rw-r--r--python/ovs/daemon.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py
index eaaaa519b..6dff3a02f 100644
--- a/python/ovs/daemon.py
+++ b/python/ovs/daemon.py
@@ -52,6 +52,8 @@ _monitor = False
# File descriptor used by daemonize_start() and daemonize_complete().
_daemonize_fd = None
+RESTART_EXIT_CODE = 5
+
def make_pidfile_name(name):
"""Returns the file name that would be used for a pidfile if 'name' were
provided to set_pidfile()."""
@@ -266,6 +268,11 @@ def _fork_notify_startup(fd):
os.close(fd)
def _should_restart(status):
+ global RESTART_EXIT_CODE
+
+ if os.WIFEXITED(status) and os.WEXITSTATUS(status) == RESTART_EXIT_CODE:
+ return True
+
if os.WIFSIGNALED(status):
for signame in ("SIGABRT", "SIGALRM", "SIGBUS", "SIGFPE", "SIGILL",
"SIGPIPE", "SIGSEGV", "SIGXCPU", "SIGXFSZ"):