diff mbox series

[ovs-dev,2/2] rhel: Skip systemctl redirect.

Message ID 1507288103-16077-2-git-send-email-guru@ovn.org
State Accepted
Headers show
Series [ovs-dev,1/2] ovs-ctl.in: Call 'hostname -f' after vswitchd starts. | expand

Commit Message

Gurucharan Shetty Oct. 6, 2017, 11:08 a.m. UTC
We still use SysV scripts for RHEL. Currently, invoking
/etc/init.d/openvswitch will redirect the calls to
dynamically generated systemd scripts. In the above case when you call
"/etc/init.d/openvswitch-switch start", it inturn calls
"/bin/systemctl start openvswitch-switch.service" and
that inturn again calls "/etc/init.d/openvswitch-switch start"

This patch avoids it.  This is similar to what was done to
Debian in commit 873d85653d8 (debian: Skip systemctl redirect.)

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
---
 rhel/etc_init.d_openvswitch | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ben Pfaff Oct. 6, 2017, 10:27 p.m. UTC | #1
On Fri, Oct 06, 2017 at 04:08:23AM -0700, Gurucharan Shetty wrote:
> We still use SysV scripts for RHEL. Currently, invoking
> /etc/init.d/openvswitch will redirect the calls to
> dynamically generated systemd scripts. In the above case when you call
> "/etc/init.d/openvswitch-switch start", it inturn calls
> "/bin/systemctl start openvswitch-switch.service" and
> that inturn again calls "/etc/init.d/openvswitch-switch start"
> 
> This patch avoids it.  This is similar to what was done to
> Debian in commit 873d85653d8 (debian: Skip systemctl redirect.)
> 
> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
> ---
>  rhel/etc_init.d_openvswitch | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/rhel/etc_init.d_openvswitch b/rhel/etc_init.d_openvswitch
> index 3921aab..caf24cc 100755
> --- a/rhel/etc_init.d_openvswitch
> +++ b/rhel/etc_init.d_openvswitch
> @@ -27,6 +27,8 @@
>  # Short-Description: Open vSwitch switch
>  ### END INIT INFO
>  
> +SYSTEMCTL_SKIP_REDIRECT=yes

Thank you for finding this and fixing it.

The Debian scripts set this variable and another one with an extra
leading _.  I don't know the reason.  Should the RHEL script do the
same?

Acked-by: Ben Pfaff <blp@ovn.org>
Gurucharan Shetty Oct. 7, 2017, 2:15 a.m. UTC | #2
On 6 October 2017 at 15:27, Ben Pfaff <blp@ovn.org> wrote:

> On Fri, Oct 06, 2017 at 04:08:23AM -0700, Gurucharan Shetty wrote:
> > We still use SysV scripts for RHEL. Currently, invoking
> > /etc/init.d/openvswitch will redirect the calls to
> > dynamically generated systemd scripts. In the above case when you call
> > "/etc/init.d/openvswitch-switch start", it inturn calls
> > "/bin/systemctl start openvswitch-switch.service" and
> > that inturn again calls "/etc/init.d/openvswitch-switch start"
> >
> > This patch avoids it.  This is similar to what was done to
> > Debian in commit 873d85653d8 (debian: Skip systemctl redirect.)
> >
> > Signed-off-by: Gurucharan Shetty <guru@ovn.org>
> > ---
> >  rhel/etc_init.d_openvswitch | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/rhel/etc_init.d_openvswitch b/rhel/etc_init.d_openvswitch
> > index 3921aab..caf24cc 100755
> > --- a/rhel/etc_init.d_openvswitch
> > +++ b/rhel/etc_init.d_openvswitch
> > @@ -27,6 +27,8 @@
> >  # Short-Description: Open vSwitch switch
> >  ### END INIT INFO
> >
> > +SYSTEMCTL_SKIP_REDIRECT=yes
>
> Thank you for finding this and fixing it.
>
> The Debian scripts set this variable and another one with an extra
> leading _.  I don't know the reason.  Should the RHEL script do the
> same?
>
The Debian did both because there were some systems were systemd would only
accept one with "_".
I haven't tested this across multiple RHEL systems. My idea is that if we
find one, we will add another commit.


>
> Acked-by: Ben Pfaff <blp@ovn.org>
>
Thanks. I applied this to master and will backport to relevent branches.
diff mbox series

Patch

diff --git a/rhel/etc_init.d_openvswitch b/rhel/etc_init.d_openvswitch
index 3921aab..caf24cc 100755
--- a/rhel/etc_init.d_openvswitch
+++ b/rhel/etc_init.d_openvswitch
@@ -27,6 +27,8 @@ 
 # Short-Description: Open vSwitch switch
 ### END INIT INFO
 
+SYSTEMCTL_SKIP_REDIRECT=yes
+
 . /usr/share/openvswitch/scripts/ovs-lib || exit 1
 test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch