mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Fix state machine ordering issue
This patch fixes an ordering issue where the configuration generation is stepped before all old/disabled services had been stopped. Finit should ensure disabled services are stopped before entering the next generation. If the genation is stepped first, all conditions are put in "flux" state, so, e.g, a podman container running as a sysv service may lock-up until it is killed by Finit. Found in the Infix OS project. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -359,6 +359,8 @@ restart:
|
||||
break;
|
||||
|
||||
case SM_RELOAD_CHANGE_STATE:
|
||||
sm.in_reload = 1;
|
||||
|
||||
/* First reload all *.conf in /etc/finit.d/ */
|
||||
conf_reload();
|
||||
|
||||
@@ -367,10 +369,11 @@ restart:
|
||||
* let all affected services move to WAITING/HALTED
|
||||
*/
|
||||
dbg("Stopping services not allowed after reconf ...");
|
||||
sm.in_reload = 1;
|
||||
cond_reload();
|
||||
service_step_all(SVC_TYPE_ANY);
|
||||
|
||||
/* Step the generation ... */
|
||||
cond_reload();
|
||||
|
||||
sm.state = SM_RELOAD_WAIT_STATE;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user