mirror of
https://github.com/troglobit/finit.git
synced 2026-09-30 21:13:01 +07:00
Fix #362: prevent blocking main loop when starting run tasks
Drop complete() logic, waiting for run tasks to finish, from the service_start() funciton to the general service_monitor(). This refactor frees up the main loop and allows us to answer any API calls from initctl even from the run task itself. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ assert_restarts()
|
||||
|
||||
assert_restart_cnt()
|
||||
{
|
||||
assert "Finit restart cnt $1" "$(texec initctl status "$2" | awk '/Restarts/{print $4;}')" = "($1)"
|
||||
assert "Finit restart total $1 cnt $2" "$(texec initctl status "$3" | awk '/Restarts/{print $3 $4;}')" = "$1($2)"
|
||||
}
|
||||
|
||||
assert_norestart()
|
||||
|
||||
@@ -22,12 +22,6 @@ test_teardown()
|
||||
run "rm -f $FINIT_CONF"
|
||||
}
|
||||
|
||||
check_restarts()
|
||||
{
|
||||
assert "serv restarts" "$(texec cat "$1" | awk '{print $1;}')" -ge "$2"
|
||||
}
|
||||
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
. "$TEST_DIR/lib/setup.sh"
|
||||
|
||||
@@ -43,7 +37,7 @@ test_one()
|
||||
run "initctl reload"
|
||||
# run "initctl status fail.sh"
|
||||
|
||||
assert_restart_cnt "$num/10" fail.sh
|
||||
assert_restart_cnt "$num" "0/10" fail.sh
|
||||
}
|
||||
|
||||
sep
|
||||
|
||||
Reference in New Issue
Block a user