mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 14:02:52 +07:00
Fix segfault, stop a crashing service before deleting it
Finit tries to restart crashing services. If a service is removed before Finit has given up restarting it, then the background timer responsible the restart may dereference a free():d svc_t. Hence, make sure to properly stop (and step) a service and its timer callbacks in service_unregister() before calling svc_del(). Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -857,6 +857,9 @@ void service_unregister(svc_t *svc)
|
||||
if (!svc)
|
||||
return;
|
||||
|
||||
service_stop(svc);
|
||||
service_step(svc);
|
||||
|
||||
if (svc_is_inetd(svc)) {
|
||||
if (svc_is_busy(svc->inetd.svc)) {
|
||||
svc_unblock(svc->inetd.svc);
|
||||
|
||||
Reference in New Issue
Block a user