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>
# File descriptor used by daemonize_start() and daemonize_complete().
_daemonize_fd = None
# File descriptor used by daemonize_start() and daemonize_complete().
_daemonize_fd = None
def make_pidfile_name(name):
"""Returns the file name that would be used for a pidfile if 'name' were
provided to set_pidfile()."""
def make_pidfile_name(name):
"""Returns the file name that would be used for a pidfile if 'name' were
provided to set_pidfile()."""
os.close(fd)
def _should_restart(status):
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"):
if os.WIFSIGNALED(status):
for signame in ("SIGABRT", "SIGALRM", "SIGBUS", "SIGFPE", "SIGILL",
"SIGPIPE", "SIGSEGV", "SIGXCPU", "SIGXFSZ"):
# Start daemon to monitor external ids
PYTHONPATH=/usr/share/openvswitch/python \
/usr/share/openvswitch/scripts/ovs-external-ids \
# Start daemon to monitor external ids
PYTHONPATH=/usr/share/openvswitch/python \
/usr/share/openvswitch/scripts/ovs-external-ids \
- --pidfile --detach "$VSWITCHD_OVSDB_SERVER"
+ --pidfile --detach $monitor_opt "$VSWITCHD_OVSDB_SERVER"
touch /var/lock/subsys/openvswitch
}
touch /var/lock/subsys/openvswitch
}
raise
except:
s_log.exception("traceback")
raise
except:
s_log.exception("traceback")
+ sys.exit(ovs.daemon.RESTART_EXIT_CODE)