[ovs-dev] [PATCH] utilities: ovs-lib: Signal start_daemon failures

Markos Chandras mchandras at suse.de
Fri Sep 9 15:08:48 UTC 2016


On 09/09/2016 04:05 PM, Aaron Conole wrote:
> Markos Chandras <mchandras at suse.de> writes:
> 
>> Make sure we communicate failures to the caller when start_daemon fails
>> to start a process as the caller may not be able to proceed after this.
>>
>> Signed-off-by: Markos Chandras <mchandras at suse.de>
>> ---
>>  utilities/ovs-lib.in | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
>> index 773efb3..6fd861e 100644
>> --- a/utilities/ovs-lib.in
>> +++ b/utilities/ovs-lib.in
>> @@ -190,7 +190,7 @@ start_daemon () {
>>          set nice -n "$priority" "$@"
>>      fi
>>  
>> -    action "Starting $daemon" "$@"
>> +    action "Starting $daemon" "$@" || return 1
>>  
>>      if test X"$strace" != X; then
>>          # Strace doesn't have the -D option so we attach after the fact.
> 
> I agree with this change, but I think it needs to be extended all the
> way (so, that means into ovs-ctl as well).  Currently, there's no
> difference in the script return value when I have your patch applied or
> not (ie: ovs-ctl --no-ovsdb-server start and then echo $? yields 0 when
> I have renamed ovs-vswitchd to cause failure).
> 
> Is it possible for you to post a follow-up patch for ovs-ctl.in that looks
> something like below (NOTE: not tested at all - caveat emptor)?
> 

Hi Aaron,

Thanks. I actually had the exact same patch in my local repo but I
wanted to check that breaking out from start_daemon when 'action' fails
is a desired thing. I couldn't think of a case where people might want
to continue after that but I may be missing something. I am happy to
post a v2 with the ovs-ctl changes.

-- 
markos

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg



More information about the dev mailing list