Conversation
…ce that owns the ubus "service" object Signed-off-by: Au Ychen <au-ychen@foxmail.com>
Aukansh
marked this pull request as ready for review
September 17, 2026 12:02
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.
Since commit f4d512d93a00a701c9604376e759ec60960d4dfb ("jail: place container init and exec into the target cgroup via clone3"), restarting a service that provides the ubus
serviceobject fails, and the service disappears from procd's service tree. On OpenWrt this is easily observable onrpcd.instance_remove_cgroup() is called from instance_delete() while procd
is still processing a "service delete" ubus call issued by the service's
own init script (e.g. "/etc/init.d/rpcd restart" -> "stop" -> ubus call
service delete). Writing "1" to cgroup.kill at that point kills every
task in the cgroup, including the shell running the init script right
now. The shell dies before it can proceed to the "start" phase, the
service is left torn down, its name disappears from the services tree,
and a subsequent restart fails with:
Command failed: ubus call service delete { "name": "rpcd" } (Not found)
Fix this by simply attempting to remove the cgroup and ignoring EBUSY:
if the cgroup still has tasks, it is left in place and reused by the
next instance_start(); the kernel retires it once its last task exits.