diff options
author | Ben Pfaff <blp@nicira.com> | 2010-01-15 13:09:32 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-01-15 15:29:54 -0800 |
commit | f3ac83df5c4fec3f27a9c8f95ef2753a26c65d24 (patch) | |
tree | d604978399770a11c7a27f3ba36783e1215b2918 /debian | |
parent | ff8decf1a318b4a611cb08bb3f12833044e8a872 (diff) |
Enable daemon monitoring and automatic restart by default.
Tested on a XenServer by running "kill -SEGV" on the daemon processes and
watching them restart automatically and by running plain "kill" and
watching them terminate normally.
Diffstat (limited to 'debian')
-rwxr-xr-x | debian/openvswitch-switch.init | 13 | ||||
-rw-r--r-- | debian/openvswitch-switch.template | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 5d37d707..1f65b693 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -33,11 +33,14 @@ DODTIME=1 # Time to wait for the server to die, in seconds unset OVSDB_SERVER_OPTS unset OVS_VSWITCHD_OPTS unset CORE_LIMIT +unset ENABLE_MONITOR default=/etc/default/openvswitch-switch if [ -f $default ] ; then . $default fi +: ${ENABLE_MONITOR:=y} + set -e # running_pid pid name @@ -209,11 +212,17 @@ case "$1" in /usr/share/openvswitch/vswitch-idl.ovsschema fi + if test "$ENABLE_MONITOR" = y; then + monitor_opt=--monitor + else + monitor_opt= + fi + # Start ovsdb-server. set -- set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err set -- "$@" --log-file - set -- "$@" --detach --pidfile + set -- "$@" --detach --pidfile $monitor_opt set -- "$@" --remote punix:/var/run/ovsdb-server set -- "$@" /etc/openvswitch-switch/conf set -- "$@" $OVSDB_SERVER_OPTS @@ -232,7 +241,7 @@ case "$1" in set -- set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err set -- "$@" --log-file - set -- "$@" --detach --pidfile + set -- "$@" --detach --pidfile $monitor_opt set -- "$@" unix:/var/run/ovsdb-server set -- "$@" $OVS_VSWITCHD_OPTS echo -n "Starting ovs-vswitchd: " diff --git a/debian/openvswitch-switch.template b/debian/openvswitch-switch.template index 6da1ed77..e36fc689 100644 --- a/debian/openvswitch-switch.template +++ b/debian/openvswitch-switch.template @@ -19,3 +19,7 @@ OVS_VSWITCHD_OPTS= # will disable core dumps. Setting it to "unlimited" will dump all # core files regardless of size. #CORE_LIMIT=unlimited + +# ENABLE_MONITOR: If 'y' then monitor daemon processes and restart them +# if they die due to an error signal. +# ENABLE_MONITOR=y |