Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#59,942 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
android, kotlin

Direzione di ricerca

Trova la configurazione della sandbox di Android shell che crea gli argomenti bind di proot e verifica come gestisce i percorsi host facoltativi. Inizia individuando i bind esistenti di /system, /vendor e /apex, poi segui il percorso fino al punto in cui vengono testati questi argomenti. Il lavoro è completato quando /debug_ramdisk viene montato se esiste e su dalla shell può raggiungere il daemon di Magisk; i dispositivi senza root devono continuare a funzionare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
221k
Fork
29.6k
Merge medio
5h 32m
PR unite (30g)
492

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.