Skip to content

service: preserve explicit stop for remain tasks - #511

Open
zhangxiaohui1 wants to merge 1 commit into
finit-project:masterfrom
zhangxiaohui1:fix/remain-task-control
Open

zhangxiaohui1 wants to merge 1 commit into
finit-project:masterfrom
zhangxiaohui1:fix/remain-task-control

Conversation

@zhangxiaohui1

@zhangxiaohui1 zhangxiaohui1 commented Oct 21, 2026 •

Copy link
Copy Markdown

Summary

A completed remain-after-exit task currently clears its user stop
block after its post script completes. If the task is valid in the
current runlevel, this causes it to start again immediately, making
initctl stop ineffective.

This change:

  • preserves SVC_BLOCK_USER after an explicit stop
  • distinguishes restart transitions from explicit stops
  • makes initctl restart tear down and rerun completed remain tasks
  • preserves reload and runlevel transition behavior
  • adds regression coverage for stop, start, restart, reload, and
    runlevel transitions

Testing

  • New remain-task-control.sh regression test passes
  • runlevel.sh passes
  • restart-self.sh passes
  • reload-while-paused.sh passes
  • Full suite: 46 passed, 1 skipped, 1 environment-related failure
    (conf-dirs.sh requires subordinate UID/GID mapping unavailable
    with the host's older unshare)

A completed remain task unconditionally cleared its user stop block
after running its post script.  Since it was still valid in the current
runlevel, it immediately started again, making initctl stop ineffective.

Keep explicit stops blocked, distinguish automatic and requested
restarts, and route initctl restart through teardown before rerunning the
task.  Cover stop, start, restart, reload, and runlevel transitions with
a regression test.

Signed-off-by: zhangxiaohui <xiaohui.zhang@wbstar.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant