Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#59,942 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, kotlin
Lĩnh vực
infrastructure, mobile

Hướng nghiên cứu

Tìm cấu hình sandbox Android shell tạo các đối số bind của proot và kiểm tra cách cấu hình xử lý các đường dẫn host tùy chọn. Trước tiên, hãy tìm các bind hiện có của /system, /vendor và /apex, sau đó lần theo nơi kiểm thử các đối số đó. Công việc hoàn tất khi /debug_ramdisk được bind nếu nó tồn tại và su trong shell có thể truy cập daemon của Magisk; các thiết bị chưa root vẫn phải tiếp tục hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
221k
Fork
29.6k
Merge trung bình
5 giờ 32 phút
Pull request đã merge (30 ngày)
492

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.