~alpine/aports

2 2

Re: [alpine-aports] [PATCH] main/openvswitch: fix ifupdown script

Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20150825094747.0471379c@ncopa-desktop.alpinelinux.org>
Sender timestamp
1440488867
DKIM signature
missing
Download raw message
On Mon, 17 Aug 2015 22:39:22 +0000
Stuart Cardall <developer@it-offshore.co.uk> wrote:

> --- a/main/openvswitch/ifupdown.sh
> +++ b/main/openvswitch/ifupdown.sh
> @@ -29,7 +29,9 @@ if (ovs_vsctl --version) > /dev/null 2>&1; then :; else
>      exit 0
>  fi
>  
> -if /etc/init.d/ovs-vswitchd status > /dev/null 2>&1; then :; else
> +if ! /etc/init.d/ovs-vswitchd status &>/dev/null; then
> +    /etc/init.d/ovs-modules start
> +    /etc/init.d/ovsdb-server start
>      /etc/init.d/ovs-vswitchd start
>  fi
>  

Why don't we add ovsdb-server and ovs-modules as dependencies for ovs-vswitchd?

If it is not a hard dependency (but a configurable, soft dependency),
then maybe the /etc/conf.d/ovs-vswitchd should have:

  rc_depend="ovs-modules ovsdb-server"

I think hardcoding it in the ifupdown.sh script is wrong in case the
dependencies for the ovs-vswitchd service changes in future version.


-nc


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---

Re: [alpine-aports] [PATCH] main/openvswitch: fix ifupdown script

Details
Message ID
<55DCF51C.5060201@it-offshore.co.uk>
In-Reply-To
<20150825094747.0471379c@ncopa-desktop.alpinelinux.org> (view parent)
Sender timestamp
1440544028
DKIM signature
missing
Download raw message
Adding rc_depends to /etc/conf.d/ovs-vswitchd did not start the depends.

Starting init scripts from within a shell script does not start the
depends so I revised the ifupdown script to loop through:

DEPENDS=$(/lib/rc/bin/rc-depend -t ineed -qq ovs-vswitchd)

2 new ovs patches sent a little earlier.

Stuart.

On 25/08/15 08:47, Natanael Copa wrote:
> On Mon, 17 Aug 2015 22:39:22 +0000
> Stuart Cardall <developer@it-offshore.co.uk> wrote:
>
>> --- a/main/openvswitch/ifupdown.sh
>> +++ b/main/openvswitch/ifupdown.sh
>> @@ -29,7 +29,9 @@ if (ovs_vsctl --version) > /dev/null 2>&1; then :; else
>>      exit 0
>>  fi
>>  
>> -if /etc/init.d/ovs-vswitchd status > /dev/null 2>&1; then :; else
>> +if ! /etc/init.d/ovs-vswitchd status &>/dev/null; then
>> +    /etc/init.d/ovs-modules start
>> +    /etc/init.d/ovsdb-server start
>>      /etc/init.d/ovs-vswitchd start
>>  fi
>>  
> Why don't we add ovsdb-server and ovs-modules as dependencies for ovs-vswitchd?
>
> If it is not a hard dependency (but a configurable, soft dependency),
> then maybe the /etc/conf.d/ovs-vswitchd should have:
>
>   rc_depend="ovs-modules ovsdb-server"
>
> I think hardcoding it in the ifupdown.sh script is wrong in case the
> dependencies for the ovs-vswitchd service changes in future version.
>
>
> -nc

Re: [alpine-aports] [PATCH] main/openvswitch: fix ifupdown script

Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20150902153808.09f49f6d@ncopa-desktop.alpinelinux.org>
In-Reply-To
<55DCF51C.5060201@it-offshore.co.uk> (view parent)
Sender timestamp
1441201088
DKIM signature
missing
Download raw message
On Wed, 26 Aug 2015 00:07:08 +0100
IT Developer <developer@it-offshore.co.uk> wrote:

> Adding rc_depends to /etc/conf.d/ovs-vswitchd did not start the depends.
> Starting init scripts from within a shell script does not start the
> depends 

How was the script started? via a manual "ifup something" of pulled in
from the networking service?

> so I revised the ifupdown script to loop through:
> 
> DEPENDS=$(/lib/rc/bin/rc-depend -t ineed -qq ovs-vswitchd)
> 
> 2 new ovs patches sent a little earlier.

I still don't like this.

Questions:

- Are there any situation that ovs-vswitchd may run without that
  ovsdb-server runs? eg can you run ovsdb-server on a remove host? can
  you run a ovs-vswitchd configuration without ovsdb-server?

- If both ovsdb-server and ovs-vswitchd serivce are running, and you
  stop or restart the ovsdb-server service. What should happen? should
  ovs-vswitchd also stop/restart?

When it comes to the ovs-modules service, it is fully possible to
configure your system so that you load kernel module vi /etc/modules so
you technically dont need the ovs-modules serivce (I suppose). If that
is the case, then I don't start it in a hardcoded script.


What i think is:
if you have marked ovs-vswitchd service to autostart at boot and also
marked networking service to autostart, then should the openrc
dependency handling make sure that ovsd-vswitchd is started before
networking. (ovs-vswitchd should have an rc_before="networking")

If there are any valid (theoretical) situations where you need to start
networking service before you start ovs-vswitchd (maybe ovsdb-server is
on a remote host?), then we cannot hardcode it and the start order
needs to be a part of configuration (eg /etc/conf.d)

The only time the ovs-vswitchd service may be started from the
ifupdown.sh script is when "networking" is not started, and you do
"ifup ovsbr0" or similar, but then should the dependencies for the
ovs-vswitchd be pulled in by openrc, not by the ifupdown.sh script.

-nc

> 
> Stuart.
> 
> On 25/08/15 08:47, Natanael Copa wrote:
> > On Mon, 17 Aug 2015 22:39:22 +0000
> > Stuart Cardall <developer@it-offshore.co.uk> wrote:
> >
> >> --- a/main/openvswitch/ifupdown.sh
> >> +++ b/main/openvswitch/ifupdown.sh
> >> @@ -29,7 +29,9 @@ if (ovs_vsctl --version) > /dev/null 2>&1; then :; else
> >>      exit 0
> >>  fi
> >>  
> >> -if /etc/init.d/ovs-vswitchd status > /dev/null 2>&1; then :; else
> >> +if ! /etc/init.d/ovs-vswitchd status &>/dev/null; then
> >> +    /etc/init.d/ovs-modules start
> >> +    /etc/init.d/ovsdb-server start
> >>      /etc/init.d/ovs-vswitchd start
> >>  fi
> >>  
> > Why don't we add ovsdb-server and ovs-modules as dependencies for ovs-vswitchd?
> >
> > If it is not a hard dependency (but a configurable, soft dependency),
> > then maybe the /etc/conf.d/ovs-vswitchd should have:
> >
> >   rc_depend="ovs-modules ovsdb-server"
> >
> > I think hardcoding it in the ifupdown.sh script is wrong in case the
> > dependencies for the ovs-vswitchd service changes in future version.
> >
> >
> > -nc
> 



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)