[ovs-dev] [PATCH v2] debian: Change openvswitch restart logic for kernel package.

Gurucharan Shetty shettyg at nicira.com
Thu Jan 17 21:35:06 UTC 2013


On Thu, Jan 17, 2013 at 1:11 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Thu, Jan 17, 2013 at 12:44:11PM -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.
>
> I think that this could be better stated.  Instead of "This is
> unnecessary..." how about:
>
>    This has no useful effect when an Open vSwitch kernel module is
>    already loaded, because "/etc/init.d/openvswitch restart" does not
>    load the new version of the kernel module.

Okay.
>
>> +# If the kernel module is not loaded and the openvswitch-switch is installed,
>> +# restart it. This ensures that the kernel module will be loaded.
>
> How about, instead of the above:
>
>    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.
>
Okay.

>>  # (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.)
>> +if [ -e /sys/module/openvswitch ] || [ -e /sys/module/openvswitch_mod ]; then
>> +    exit 0
>> +fi
>> +
>>  INIT=/etc/init.d/openvswitch-switch
>> -if test -x $INIT && $INIT status; then
>> +if test -x $INIT; then
>>      $INIT restart || true
>
> I think that maybe we should only do "start" and not "restart".
> Otherwise, if Open vSwitch is running, then installing a module for a
> non-running kernel will disrupt traffic for a little while.
Will do. Though I am not sure how Open vSwitch could be running
without the kernel module (Userspace only?).

Thanks,
Guru



More information about the dev mailing list