X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debian%2Fopenvswitch-datapath-module-_KVERS_.postinst.modules.in;h=3ed480080a67deb5cc11443bf5986674b3305ca9;hb=0ef165ecb57943e17a8ee8270df68ffb8d032e29;hp=0268300821411881ca8e1b35402eb1be37e0502b;hpb=064af42167bf4fc9aaea2702d80ce08074b889c0;p=sliver-openvswitch.git diff --git a/debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in b/debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in index 026830082..3ed480080 100755 --- a/debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in +++ b/debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in @@ -5,21 +5,23 @@ set -e -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. +# If the kernel module is already loaded, we have nothing to do here. +# A force-reload-kmod should be run manually to use the new kernel module. +if [ -e /sys/module/openvswitch ] || [ -e /sys/module/openvswitch_mod ]; then + exit 0 +fi + +# If the kernel module is not loaded, then it is likely because none +# was installed before and therefore Open vSwitch couldn't be started. +# Try to start it now. # # (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/openvswitch-switch -if test -x $INIT && $INIT status; then - $INIT restart || true +if test -x $INIT; then + $INIT start || true fi exit 0 - -