Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 380317

Summary: sys-apps/openrc-0.8.3 does not catch custom init functions' exit code
Product: Gentoo Hosted Projects Reporter: flex <frostynova>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: hongqn
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 381523    

Description flex 2011-08-23 04:38:38 UTC
when using custom init functions, such as reload() in /etc/init.d/nginx, although the function exit without zero, init script exitcode will be zero.

Reproducible: Always

Steps to Reproduce:
1. make some syntax error in /etc/nginx/nginx.conf
2. /etc/init.d/nginx reload, you will see error
3. echo $?
Actual Results:  
exit code is 0

Expected Results:  
it should be the reload function's exitcode

i browse the openrc sourc, and find in src/rc/runscript.c:1385

svc_exec(optarg, NULL);

here does not catch the return code, i think it should be

retval = svc_exec(optarg, NULL);
Comment 1 William Hubbs gentoo-dev 2011-09-02 17:46:27 UTC
I tested your change, and you are correct. This has been added to git as
commit 6d5b452, and it will be part of the next openrc release.
Comment 2 flex 2011-09-02 17:51:36 UTC
(In reply to comment #1)
> I tested your change, and you are correct. This has been added to git as
> commit 6d5b452, and it will be part of the next openrc release.

er, may i ask when will be the next version released?