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
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.