android: su fails with "No daemon is currently running!" because the shell sandbox does not bind /debug_ramdisk
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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分
- マージ済み PR(30日)
- 492
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
marmelab/react-admin#11431 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
db-ux-design-system/core-web#8655 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effectオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
epam/statgpt-admin-frontend#305 ·
メンテナーはふだん 1 日以内に返信