Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

android: su fails with "No daemon is currently running!" because the shell sandbox does not bind /debug_ramdisk

未关闭 适合新手
#59,942 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
android, kotlin

调研方向

找到创建 proot bind 参数的 Android shell 沙箱设置,并检查它如何处理可选的主机路径。首先定位现有的 /system、/vendor 和 /apex bind,然后追踪这些参数在哪里接受测试。当 /debug_ramdisk 存在时会被 bind,且 shell 中的 su 能访问 Magisk 的守护进程,即表示完成;未 root 的设备应继续正常工作。

由索引模型根据 Issue 内容生成。

描述

triaging
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
  1. On a Magisk-rooted device, run su -c id in the agent shell.
  2. Observe No daemon is currently running!.
  3. 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。