From: Ben Pfaff Date: Wed, 5 Nov 2008 18:22:41 +0000 (-0800) Subject: When a new OpenFlow kernel module package is installed, restart the switch. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e061502c94f262adf2932c75ac40e2312438300;p=openvswitch When a new OpenFlow kernel module package is installed, restart the switch. This helps to ensure that the secchan and the kernel module are exactly the same version. --- diff --git a/debian/openflow-datapath-module-_KVERS_.postinst.modules.in b/debian/openflow-datapath-module-_KVERS_.postinst.modules.in index 49e52d63..6974e13a 100755 --- a/debian/openflow-datapath-module-_KVERS_.postinst.modules.in +++ b/debian/openflow-datapath-module-_KVERS_.postinst.modules.in @@ -9,6 +9,17 @@ depmod -a #DEBHELPER# +# If the switch is running, restart it. This ensures that we are using the +# latest kernel module, because the init script will unload and reload the +# module. +# +# (Ideally we'd only want to do this if this package corresponds to the +# running kernel, but I don't know a reliable way to check.) +INIT=/etc/init.d/openflow-switch +if test -x $INIT && $INIT status; then + $INIT restart || true +fi + exit 0