Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 380317 - sys-apps/openrc-0.8.3 does not catch custom init functions' exit code
Summary: sys-apps/openrc-0.8.3 does not catch custom init functions' exit code
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 381523
  Show dependency tree
 
Reported: 2011-08-23 04:38 UTC by flex
Modified: 2011-09-02 17:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?