android: su fails with "No daemon is currently running!" because the shell sandbox does not bind /debug_ramdisk
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- android, kotlin
- 领域
- infrastructure, mobile
调研方向
找到创建 proot bind 参数的 Android shell 沙箱设置,并检查它如何处理可选的主机路径。首先定位现有的 /system、/vendor 和 /apex bind,然后追踪这些参数在哪里接受测试。当 /debug_ramdisk 存在时会被 bind,且 shell 中的 su 能访问 Magisk 的守护进程,即表示完成;未 root 的设备应继续正常工作。
由索引模型根据 Issue 内容生成。
描述
Description
On a Magisk-rooted Android device, su from the agent shell always fails:
$ su -c id
No daemon is currently running! # exit 1
$ magisk -c
28.1:MAGISK:R (28100) # client binary is fine
$ magisk --path
(empty) # tmp dir not discoverable
Root is healthy: in Termux on the same device su -c id returns uid=0(root), and the device mount table has magisk on /debug_ramdisk type tmpfs, magisk on /system/bin type tmpfs, magisk on /system/lib64/libzygisk.so type tmpfs.
Cause: Magisk 28.1 keeps magiskd at %s/.magisk/device/socket (format string is in the client binary), where %s is /debug_ramdisk. The Android shell runs under proot with root /data/user/0/com.opencode/files and binds only:
-b /system:/system -b /vendor:/vendor -b /apex:/apex -b /storage:/storage
-b /proc:/proc -b /dev:/dev -b <prefix>:/usr,/bin,/lib,/etc,/share,/tmp,/var,/home
-b /data/app/.../lib/arm64:/opt/oc-lib
/debug_ramdisk is missing, so the client cannot reach the socket. /proc/self/mountinfo inside the sandbox also shows no magisk mounts, consistent with magisk --path being empty.
Plugins
none
OpenCode version
2.0.27 (bootstrap 3, tools 6)
Steps to reproduce
- On a Magisk-rooted device, run
su -c idin the agent shell. - Observe
No daemon is currently running!. - Run the same in Termux: works (
uid=0).
Operating System
Android 13 (SDK 33), Realme RMX3834, arm64-v8a; shell runs as u:r:untrusted_app_27:s0
Terminal
app PTY, TERM=xterm-256color, shell oc-shell (bash)
Additional context
Fix: bind /debug_ramdisk into the sandbox when it exists (no-op on unrooted devices):
if (File("/debug_ramdisk").exists()) {
args += listOf("-b", "/debug_ramdisk:/debug_ramdisk")
}
Optionally also bind /sbin when present (older Magisk / KernelSU < 1.0). /data/adb is not needed for su and should stay out of the sandbox.
Workaround: run root commands in Termux, or start the shell with -b /debug_ramdisk:/debug_ramdisk.
- 主要语言
- TypeScript
- 星标
- 221k
- 派生
- 29.6k
- 平均合并
- 5 小时 32 分钟
- 30 天内合并 PR
- 492
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anomalyco/opencode#60174 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
anomalyco/opencode#60143 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#60121 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#59973 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
anomalyco/opencode#59886 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Graphify-Labs/graphify#4860 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
sveltejs/eslint-plugin-svelte#1615 ·
维护者通常 7 天内回复
-
Parallel reticle_verify opens per-flow leases without the source lease's ignoreHTTPSErrors可能已有人在做 @as992949791 今天认领。 未关闭good first issue help wanted
难度 2/5 1-3 小时 新手友好度 85/100
reticlehq/reticle#2033 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复