Follow-up to 2683049, only stop running, non-inet, services

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2018-01-22 20:52:37 +01:00
parent a8183b0559
commit ba2ab4b446
+8 -2
View File
@@ -857,8 +857,14 @@ void service_unregister(svc_t *svc)
if (!svc)
return;
service_stop(svc);
service_step(svc);
/*
* Only call service_stop() if @svc is still running *and* it's
* not an inetd connection. This prevents infinite recursion if
* called from service_step(), or if it's an inet connection and
* it's already been stopped.
*/
if (svc->pid && !svc_is_inetd_conn(svc))
service_stop(svc);
if (svc_is_inetd(svc)) {
if (svc_is_busy(svc->inetd.svc)) {