Repository navigation
service: preserve explicit stop for remain tasks - #511
Open
zhangxiaohui1 wants to merge 1 commit into
Open
zhangxiaohui1 wants to merge 1 commit into
zhangxiaohui1 wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A completed
remain-after-exittask currently clears its user stopblock after its post script completes. If the task is valid in the
current runlevel, this causes it to start again immediately, making
initctl stopineffective.This change:
SVC_BLOCK_USERafter an explicit stopinitctl restarttear down and rerun completed remain tasksrunlevel transitions
Testing
remain-task-control.shregression test passesrunlevel.shpassesrestart-self.shpassesreload-while-paused.shpasses(
conf-dirs.shrequires subordinate UID/GID mapping unavailablewith the host's older
unshare)