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

Bug 481672

Summary: sys-apps/openrc-0.12 - Unable to mark a service as failed
Product: Gentoo Linux Reporter: Thomas Deutschmann (RETIRED) <whissi>
Component: [OLD] Core systemAssignee: OpenRC Team <openrc>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 481064    

Description Thomas Deutschmann (RETIRED) gentoo-dev 2013-08-19 16:57:49 UTC
Hi,

while trying Alexander's suggestion in #481064 I noticed I cannot mark a service as failed:

# /lib64/rc/bin/service_started test
# echo $?
1
# /lib64/rc/sbin/mark_service_started test
# echo $?
0
# /lib64/rc/bin/service_started test
# echo $?
0
# /lib64/rc/sbin/mark_service_failed test
# echo $?
0
# /lib64/rc/bin/service_crashed test
# echo $?
1


Tried with openrc-0.11.8 and openrc-0.12, same result: Unable to mark server "test" as failed".

Reproducible: Always
Comment 1 Alexander Vershilov (RETIRED) gentoo-dev 2013-08-20 05:58:27 UTC
the real problem I have not discovered at the moment of suggesting a  solution, that failed state is an internal one that is used while we are switching runlevels and it's not shown to user:

# /lib64/rc/sbin/mark_service_failed test
 ls /run/openrc/failed/
test

So service now is in failed state, however rc-status will show just stopped, but if you'll try to start service depending on 'test' it will failed.

Original suggestion will not work because rc clears failed service on exit. See clean_failed function in rc.c. So after runlevel is switched and before new one is started we loose all information on failed services.

I'll close this bug as WORKSFORME. Feel free to reopen. We will work on a double start in a original bug.