You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
initctl stop restarts completed remain-after-exit tasks after exec-stop-post #520
A completed task with remain-after-exit = true and an exec-stop-post command starts again immediately after initctl stop when it is enabled in the current runlevel. This makes an explicit stop ineffective.
This report tracks the behavior described in #511. The reproducer below is adapted from that PR's regression test.
Steps to reproduce
On a Finit system without the fix in #511, in runlevel 2, 3, 4, or 5, create /etc/finit.d/remain-task.conf:
Wait until initctl status remain-task shows done and the state file exists.
Run initctl stop remain-task.
Check the task status and whether /run/remain-task.state still exists.
Expected behavior
The post command removes the state file, and the task remains stopped. The explicit user stop must not trigger another execution.
Actual behavior
The post command runs, but the task starts again and recreates the state file instead of remaining stopped.
Cause and related fix
In the teardown path in src/service.c, remain tasks are unconditionally unblocked after the post command. This clears SVC_BLOCK_USER, allowing a task enabled in the current runlevel to run again.
PR #511 preserves the explicit stop block, distinguishes restart transitions from user stops, and adds regression coverage for stop, start, restart, reload, and runlevel transitions.
Activity