Project

General

Profile

Feature #5485

service-utils.inc/service_control_stop() needs some checks before claiming success

Added by Kill Bill over 3 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Operating System
Target version:
Start date:
11/19/2015
Due date:
% Done:

0%

Estimated time:

Description

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.

https://github.com/pfsense/pfsense/blob/master/src/etc/inc/service-utils.inc#L730

History

#1 Updated by Jim Thompson over 3 years ago

  • Tracker changed from Bug to Feature
  • Status changed from New to Rejected

stop_service() (https://github.com/pfsense/pfsense/blob/master/src/etc/inc/service-utils.inc#L119)

calls the service stop routine, if defined.

If not defined, it runs "killall servicename"
(https://github.com/pfsense/pfsense/blob/master/src/etc/inc/service-utils.inc#L142)

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

Also available in: Atom PDF