diff mbox series

[ovs-dev,3/3] rhel: add "force-reload-kmod" support in "ovs-systemd-reload"

Message ID e92dd2eda91eb80401b60823b914c05d2b6c1a99.1513954107.git.tredaelli@redhat.com
State Accepted
Headers show
Series rhel: Add force-reload-kmod support in ovs-systemd-reload | expand

Commit Message

Timothy Redaelli Dec. 22, 2017, 3 p.m. UTC
Since you can't use "ovs-ctl force-reload-kmod" on Fedora/RHEL, due to
systemd dependencies, this commit adds the "force-reload-kmod" feature on
ovs-systemd-reload.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 rhel/usr_share_openvswitch_scripts_ovs-systemd-reload | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Gregory Rose Jan. 5, 2018, 9:40 p.m. UTC | #1
On 12/22/2017 7:00 AM, Timothy Redaelli wrote:
> Since you can't use "ovs-ctl force-reload-kmod" on Fedora/RHEL, due to
> systemd dependencies, this commit adds the "force-reload-kmod" feature on
> ovs-systemd-reload.
>
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---
>   rhel/usr_share_openvswitch_scripts_ovs-systemd-reload | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload b/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
> index 5d2efc621..894df0427 100755
> --- a/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
> +++ b/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
> @@ -40,6 +40,10 @@ add_managers() {
>       :
>   }
>   
> -restart
> +if [ "$1" = "force-reload-kmod" ]; then
> +    force_reload_kmod
> +else
> +    restart
> +fi
>   
>   exit 0

Works as advertised...

Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Gurucharan Shetty April 11, 2018, 5:05 p.m. UTC | #2
On 22 December 2017 at 07:00, Timothy Redaelli <tredaelli@redhat.com> wrote:

> Since you can't use "ovs-ctl force-reload-kmod" on Fedora/RHEL, due to
> systemd dependencies, this commit adds the "force-reload-kmod" feature on
> ovs-systemd-reload.
>
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
>

Tim/Aaron,
  We have some confusion with this. So, how do we invoke this with systemd?
I guess, it is not supposed to be invoked with "service openvswitch
reload", right? And why can't we use "ovs-ctl force-reload-kmod" with
Fedora/RHEL?


> ---
>  rhel/usr_share_openvswitch_scripts_ovs-systemd-reload | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
> b/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
> index 5d2efc621..894df0427 100755
> --- a/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
> +++ b/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
> @@ -40,6 +40,10 @@ add_managers() {
>      :
>  }
>
> -restart
> +if [ "$1" = "force-reload-kmod" ]; then
> +    force_reload_kmod
> +else
> +    restart
> +fi
>
>  exit 0
> --
> 2.14.3
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Timothy Redaelli April 11, 2018, 6:03 p.m. UTC | #3
On Wed, 11 Apr 2018 10:05:53 -0700
Guru Shetty <guru@ovn.org> wrote:

> On 22 December 2017 at 07:00, Timothy Redaelli <tredaelli@redhat.com>
> wrote:
> 
> > Since you can't use "ovs-ctl force-reload-kmod" on Fedora/RHEL, due
> > to systemd dependencies, this commit adds the "force-reload-kmod"
> > feature on ovs-systemd-reload.
> >
> > Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> >  
> 
> Tim/Aaron,
>   We have some confusion with this. So, how do we invoke this with
> systemd? I guess, it is not supposed to be invoked with "service
> openvswitch reload", right? And why can't we use "ovs-ctl
> force-reload-kmod" with Fedora/RHEL?

Hi,
because on Fedora/RHEL we use systemd dependencies and so we have 3
(main) service files: openvswitch.spec, ovs-vswitchd.spec and
ovsdb-server.spec that are interconnected (see rhel/README.RHEL.rst).

If you use ovs-ctl directly systemd will loose tracks of the new
ovsdb-server and ovs-vswitchd processes and so you can't restart it by
using "systemctl restart".

Moreover it seems ovs-vswitchd is not restarted correctly in this case.
Gurucharan Shetty April 11, 2018, 7:43 p.m. UTC | #4
On 11 April 2018 at 11:03, Timothy Redaelli <tredaelli@redhat.com> wrote:

> On Wed, 11 Apr 2018 10:05:53 -0700
> Guru Shetty <guru@ovn.org> wrote:
>
> > On 22 December 2017 at 07:00, Timothy Redaelli <tredaelli@redhat.com>
> > wrote:
> >
> > > Since you can't use "ovs-ctl force-reload-kmod" on Fedora/RHEL, due
> > > to systemd dependencies, this commit adds the "force-reload-kmod"
> > > feature on ovs-systemd-reload.
> > >
> > > Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> > >
> >
> > Tim/Aaron,
> >   We have some confusion with this. So, how do we invoke this with
> > systemd? I guess, it is not supposed to be invoked with "service
> > openvswitch reload", right? And why can't we use "ovs-ctl
> > force-reload-kmod" with Fedora/RHEL?
>
> Hi,
> because on Fedora/RHEL we use systemd dependencies and so we have 3
> (main) service files: openvswitch.spec, ovs-vswitchd.spec and
> ovsdb-server.spec that are interconnected (see rhel/README.RHEL.rst).
>
> If you use ovs-ctl directly systemd will loose tracks of the new
> ovsdb-server and ovs-vswitchd processes and so you can't restart it by
> using "systemctl restart".
>
> Moreover it seems ovs-vswitchd is not restarted correctly in this case.
>

Okay. So, what is the correct way to call force-reload-kmod?
Timothy Redaelli April 12, 2018, 9:40 a.m. UTC | #5
On Wed, 11 Apr 2018 12:43:44 -0700
Guru Shetty <guru@ovn.org> wrote:

> On 11 April 2018 at 11:03, Timothy Redaelli <tredaelli@redhat.com>
> wrote:
> 
> > On Wed, 11 Apr 2018 10:05:53 -0700
> > Guru Shetty <guru@ovn.org> wrote:
> >  
> > > On 22 December 2017 at 07:00, Timothy Redaelli
> > > <tredaelli@redhat.com> wrote:
> > >  
> > > > Since you can't use "ovs-ctl force-reload-kmod" on Fedora/RHEL,
> > > > due to systemd dependencies, this commit adds the
> > > > "force-reload-kmod" feature on ovs-systemd-reload.
> > > >
> > > > Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> > > >  
> > >
> > > Tim/Aaron,
> > >   We have some confusion with this. So, how do we invoke this with
> > > systemd? I guess, it is not supposed to be invoked with "service
> > > openvswitch reload", right? And why can't we use "ovs-ctl
> > > force-reload-kmod" with Fedora/RHEL?  
> >
> > Hi,
> > because on Fedora/RHEL we use systemd dependencies and so we have 3
> > (main) service files: openvswitch.spec, ovs-vswitchd.spec and
> > ovsdb-server.spec that are interconnected (see
> > rhel/README.RHEL.rst).
> >
> > If you use ovs-ctl directly systemd will loose tracks of the new
> > ovsdb-server and ovs-vswitchd processes and so you can't restart it
> > by using "systemctl restart".
> >
> > Moreover it seems ovs-vswitchd is not restarted correctly in this
> > case. 
> 
> Okay. So, what is the correct way to call force-reload-kmod?

Fedora / RHEL 2.9.0 packages
includes /usr/share/openvswitch/scripts/ovs-systemd-reload script so
you can run:
# /usr/share/openvswitch/scripts/ovs-systemd-reload force-reload-kmod
diff mbox series

Patch

diff --git a/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload b/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
index 5d2efc621..894df0427 100755
--- a/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
+++ b/rhel/usr_share_openvswitch_scripts_ovs-systemd-reload
@@ -40,6 +40,10 @@  add_managers() {
     :
 }
 
-restart
+if [ "$1" = "force-reload-kmod" ]; then
+    force_reload_kmod
+else
+    restart
+fi
 
 exit 0