service-utils.inc/service_control_stop() needs some checks before claiming success
This is a follow-up to #5468 - this just shouldn't claim "$service has been stopped" without any checking, it says the same even in cases where no attempt to do anything has been done because the code path did not find any usable way to attempt stopping that particular service. E.g., doing something like s_process_running($foo) before spitting out the message seems like an easy way to me for most cases.
#1 Updated by Jim Thompson over 4 years ago
- Tracker changed from Bug to Feature
- Status changed from New to Rejected
calls the service stop routine, if defined.
If not defined, it runs "killall servicename"
This obviates your "no attempt to do anything has been done". If root can't kill it, what sense does it make to report same?
If you want this fixed, resubmit it with a test case.
#2 Updated by Kill Bill over 4 years ago
I am not expecting something to be killed when there's no code to get that done or when root cannot kill it... What I'm expecting is that it won't report success no matter what. (As for the code you linked - that's my patch actually, merged for #5468 ~2 days ago) so I'm well aware of that. Plus, it deals with package-installed services only.
It is actually useful to check whether something was killed or not - for one, it does not mislead users with bogus information, additionally it also helps to find bugs in the stop_service() code.