[ovs-dev] [PATCH] debian: Change openvswitch restart logic for kernel package.
Ben Pfaff
blp at nicira.com
Thu Jan 17 20:49:04 UTC 2013
On Thu, Jan 17, 2013 at 11:44:12AM -0800, Gurucharan Shetty wrote:
> On Thu, Jan 17, 2013 at 11:24 AM, Ben Pfaff <blp at nicira.com> wrote:
> > On Thu, Jan 17, 2013 at 10:30:28AM -0800, Gurucharan Shetty wrote:
> >> Currently, every time we install the non-dkms openvswitch kernel package,
> >> we restart openvswitch. This is unnecessary when there is already a kernel
> >> module insmodded.
> >>
> >> With this patch, we only restart openvswitch if there is no kernel module
> >> currently insmodded (which is a case for a fresh install of openvswitch).
> >>
> >> If someone wants to use the latest kernel module after an upgrade, they need
> >> to run "/etc/init.d/openvswitch-switch force-reload-kmod" manually.
> >>
> >> Issue #13556
> >> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
> >
> > The situation here is funny. First, the comment previously in the
> > script:
> >> -# 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.
> > was just wrong, because the init script does not unload and reload the
> > module on "restart".
> >
> > Second, the situation we end up in after the patch seems even odder.
> > The init script refuses to start Open vSwitch if the kernel module
> > cannot be loaded. So it would be odd indeed for the kernel module to
> > not be loaded but to have the switch running.
> >
> > I think that the situation that the script here is intended to cover
> > is:
> >
> > - The admin installs openvswitch-switch but there's no kernel
> > module so ovs-vswitchd doesn't start.
> >
> > - The admin installs a kernel module. Now ovs-vswitchd should
> > start.
> >
> > but I'm not sure exactly how we should do that.
>
> If I change the if condition to:
> if test -x $INIT; then
> $INIT restart || true
> fi
>
> I will restart openvswitch if there is no kernel module currently
> insmodded. That should be good, I suppose?
Yes, that seems reasonable. You will also want to update the comment.
Thanks,
Ben.
More information about the dev
mailing list