File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2418,7 +2418,21 @@ void service_update_rdeps(void)
24182418 if (!svc_is_noreload (svc ))
24192419 continue ; /* Yup, no need to stop start rdeps */
24202420
2421- svc_mark_affected (mkcond (svc , cond , sizeof (cond )));
2421+ /*
2422+ * Clear the condition immediately, before service_step_all()
2423+ * runs. cond_clear() calls cond_update() which calls
2424+ * service_step() on all affected services right now. Those
2425+ * services see COND_OFF and get service_stop() called,
2426+ * transitioning to STOPPING_STATE before we ever send SIGTERM
2427+ * to this service. Without this, the condition is only cleared
2428+ * after the service dies, by which time reverse-dependencies
2429+ * may have already crashed due to the lost connection.
2430+ * See also: api.c do_reload() which does the same for direct
2431+ * 'initctl reload <svc>' calls.
2432+ */
2433+ mkcond (svc , cond , sizeof (cond ));
2434+ cond_clear (cond );
2435+ svc_mark_affected (cond );
24222436 }
24232437}
24242438
You can’t perform that action at this time.
0 commit comments