cachyos-kernel-manager fails to execute kernel operations because temporary script is deleted before pkexec runs
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
trace に示されている terminal-helper のエントリーポイントから始め、特に一時スクリプトを作成し、kgx と pkexec を起動して、スクリプトを削除する一連の処理を確認します。kernel のインストールまたは削除を再現し、root コマンドの実行時にもスクリプトが存在していること、pacman の処理が完了すること、その後にクリーンアップが行われることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
When trying to install or remove kernels using CachyOS Kernel Manager, the operation fails because the generated temporary script is removed before it can be executed.
The terminal opens, but the command immediately fails with:
bash: /tmp/tmp.xxxxx: No such file or directory
Steps to reproduce
- Open CachyOS Kernel Manager
- Select a kernel operation (for example, remove an installed kernel)
- Confirm the operation
- Wait for the terminal window to open
Expected behavior
Kernel Manager should open the terminal, run the generated root script through pkexec, and perform the requested pacman operation.
Actual behavior
The temporary script passed to rootshell.sh no longer exists when bash tries to execute it.
Investigation
I traced the execution with strace:
❯ strace -f -e execve cachyos-kernel-manager 2>&1 | tee /tmp/kernel-manager-trace.log
execve("/usr/bin/cachyos-kernel-manager", ["cachyos-kernel-manager"], 0x7ffd16884be8 /* 57 vars */) = 0
strace: Process 206514 attached
[pid 206514] execve("/bin/sh", ["sh", "-c", "--", "findmnt -ln -o FSTYPE /"], 0x7ffdebf1c3a8 /* 57 vars */) = 0
[pid 206514] execve("/usr/bin/findmnt", ["findmnt", "-ln", "-o", "FSTYPE", "/"], 0x55fa02edd960 /* 58 vars */) = 0
[pid 206514] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206514, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 206515 attached
[pid 206515] execve("/bin/sh", ["sh", "-c", "--", "chwd --list-installed -d 2>/dev/"...], 0x7ffdebf1c3a8 /* 57 vars */) = 0
strace: Process 206516 attached
strace: Process 206517 attached
[pid 206516] execve("/usr/bin/chwd", ["chwd", "--list-installed", "-d"], 0x55f46ff36990 /* 58 vars */strace: Process 206518 attached
) = 0
[pid 206517] execve("/usr/bin/grep", ["grep", "Name"], 0x55f46ff36990 /* 58 vars */) = 0
[pid 206518] execve("/usr/bin/awk", ["awk", "{print $4}"], 0x55f46ff36990 /* 58 vars */) = 0
strace: Process 206519 attached
[pid 206519] +++ exited with 0 +++
strace: Process 206520 attached
[pid 206520] execve("/home/destoryg/.bun/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206520] execve("/usr/local/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206520] execve("/usr/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = 0
[pid 206520] +++ exited with 1 +++
[pid 206516] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206520, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
strace: Process 206521 attached
[pid 206521] execve("/home/destoryg/.bun/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206521] execve("/usr/local/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206521] execve("/usr/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = 0
[pid 206521] +++ exited with 1 +++
[pid 206516] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206521, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
strace: Process 206522 attached
[pid 206522] execve("/home/destoryg/.bun/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206522] execve("/usr/local/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206522] execve("/usr/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffe958aaf8 /* 58 vars */) = 0
[pid 206522] +++ exited with 1 +++
[pid 206516] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206522, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
[pid 206516] +++ exited with 0 +++
[pid 206517] +++ exited with 0 +++
[pid 206518] +++ exited with 0 +++
[pid 206515] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206516, si_uid=1000, si_status=0, si_utime=1 /* 0.01 s */, si_stime=2 /* 0.02 s */} ---
[pid 206515] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206515, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 206523 attached
[pid 206523] execve("/bin/sh", ["sh", "-c", "--", "chwd --list-installed -d 2>/dev/"...], 0x7ffdebf1c3a8 /* 57 vars */) = 0
strace: Process 206524 attached
strace: Process 206525 attached
strace: Process 206526 attached
[pid 206524] execve("/usr/bin/chwd", ["chwd", "--list-installed", "-d"], 0x55b249dce990 /* 58 vars */) = 0
[pid 206525] execve("/usr/bin/grep", ["grep", "Name"], 0x55b249dce990 /* 58 vars */ <unfinished ...>
[pid 206526] execve("/usr/bin/awk", ["awk", "{print $4}"], 0x55b249dce990 /* 58 vars */ <unfinished ...>
[pid 206525] <... execve resumed>) = 0
[pid 206526] <... execve resumed>) = 0
strace: Process 206527 attached
[pid 206527] +++ exited with 0 +++
strace: Process 206528 attached
[pid 206528] execve("/home/destoryg/.bun/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206528] execve("/usr/local/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206528] execve("/usr/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = 0
[pid 206528] +++ exited with 1 +++
[pid 206524] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206528, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
strace: Process 206529 attached
[pid 206529] execve("/home/destoryg/.bun/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206529] execve("/usr/local/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206529] execve("/usr/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = 0
[pid 206529] +++ exited with 1 +++
[pid 206524] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206529, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
strace: Process 206530 attached
[pid 206530] execve("/home/destoryg/.bun/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206530] execve("/usr/local/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 206530] execve("/usr/bin/systemd-detect-virt", ["systemd-detect-virt", "--vm"], 0x7fffbe4a2278 /* 58 vars */) = 0
[pid 206530] +++ exited with 1 +++
[pid 206524] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206530, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
[pid 206524] +++ exited with 0 +++
[pid 206525] +++ exited with 0 +++
[pid 206526] +++ exited with 0 +++
[pid 206523] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206524, si_uid=1000, si_status=0, si_utime=1 /* 0.01 s */, si_stime=1 /* 0.01 s */} ---
[pid 206523] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206523, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 206531 attached
strace: Process 206532 attached
strace: Process 206533 attached
strace: Process 206534 attached
strace: Process 206535 attached
strace: Process 206536 attached
strace: Process 206537 attached
strace: Process 206538 attached
strace: Process 206539 attached
strace: Process 206540 attached
strace: Process 206541 attached
strace: Process 206542 attached
strace: Process 206543 attached
strace: Process 206544 attached
strace: Process 206545 attached
strace: Process 206546 attached
strace: Process 206547 attached
strace: Process 206548 attached
strace: Process 206549 attached
strace: Process 206550 attached
strace: Process 206551 attached
strace: Process 206552 attached
[pid 206542] +++ exited with 0 +++
[pid 206541] +++ exited with 0 +++
[pid 206552] +++ exited with 0 +++
[pid 206551] +++ exited with 0 +++
[pid 206550] +++ exited with 0 +++
[pid 206549] +++ exited with 0 +++
[pid 206547] +++ exited with 0 +++
[pid 206545] +++ exited with 0 +++
[pid 206543] +++ exited with 0 +++
[pid 206540] +++ exited with 0 +++
[pid 206548] +++ exited with 0 +++
[pid 206544] +++ exited with 0 +++
[pid 206546] +++ exited with 0 +++
strace: Process 206553 attached
strace: Process 206554 attached
strace: Process 206555 attached
strace: Process 206556 attached
strace: Process 206557 attached
strace: Process 206558 attached
strace: Process 206559 attached
strace: Process 206560 attached
strace: Process 206561 attached
strace: Process 206562 attached
strace: Process 206563 attached
strace: Process 206564 attached
strace: Process 206565 attached
[pid 206565] +++ exited with 0 +++
[pid 206564] +++ exited with 0 +++
[pid 206563] +++ exited with 0 +++
[pid 206562] +++ exited with 0 +++
[pid 206561] +++ exited with 0 +++
[pid 206560] +++ exited with 0 +++
[pid 206559] +++ exited with 0 +++
[pid 206555] +++ exited with 0 +++
[pid 206553] +++ exited with 0 +++
[pid 206558] +++ exited with 0 +++
[pid 206557] +++ exited with 0 +++
[pid 206556] +++ exited with 0 +++
[pid 206554] +++ exited with 0 +++
strace: Process 206566 attached
strace: Process 206567 attached
strace: Process 206568 attached
strace: Process 206569 attached
strace: Process 206570 attached
strace: Process 206571 attached
strace: Process 206572 attached
strace: Process 206573 attached
strace: Process 206574 attached
strace: Process 206575 attached
strace: Process 206576 attached
strace: Process 206577 attached
strace: Process 206578 attached
[pid 206578] +++ exited with 0 +++
[pid 206575] +++ exited with 0 +++
[pid 206574] +++ exited with 0 +++
[pid 206572] +++ exited with 0 +++
[pid 206570] +++ exited with 0 +++
[pid 206568] +++ exited with 0 +++
[pid 206566] +++ exited with 0 +++
[pid 206573] +++ exited with 0 +++
[pid 206569] +++ exited with 0 +++
[pid 206577] +++ exited with 0 +++
[pid 206571] +++ exited with 0 +++
[pid 206567] +++ exited with 0 +++
[pid 206576] +++ exited with 0 +++
strace: Process 206579 attached
strace: Process 206580 attached
strace: Process 206581 attached
strace: Process 206582 attached
strace: Process 206583 attached
strace: Process 206584 attached
strace: Process 206681 attached
Waiting...
strace: Process 206682 attached
[pid 206682] execve("/usr/lib/cachyos-kernel-manager/terminal-helper", ["/usr/lib/cachyos-kernel-manager/"..., "-s", "pkexec /usr/lib/cachyos-kernel-m"..., "pacman -Rsn linux-cachyos-lts li"...], 0x7ffdebf1c3a8 /* 57 vars */) = 0
strace: Process 206683 attached
[pid 206683] execve("/usr/bin/mktemp", ["mktemp"], 0x55d6428c4520 /* 58 vars */) = 0
[pid 206683] +++ exited with 0 +++
[pid 206682] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206683, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 206684 attached
[pid 206684] execve("/usr/bin/kgx", ["kgx", "--wait", "--", "pkexec", "/usr/lib/cachyos-kernel-manager/"..., "/tmp/tmp.KVCNMXHwI0"], 0x55d6428c0890 /* 58 vars */) = 0
strace: Process 206685 attached
strace: Process 206686 attached
strace: Process 206687 attached
strace: Process 206688 attached
strace: Process 206697 attached
[pid 206697] +++ exited with 0 +++
[pid 206688] +++ exited with 0 +++
[pid 206687] +++ exited with 0 +++
[pid 206686] +++ exited with 0 +++
[pid 206685] +++ exited with 0 +++
[pid 206684] +++ exited with 0 +++
[pid 206682] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206684, si_uid=1000, si_status=0, si_utime=2 /* 0.02 s */, si_stime=1 /* 0.01 s */} ---
strace: Process 206699 attached
[pid 206699] execve("/usr/bin/rm", ["rm", "/tmp/tmp.KVCNMXHwI0"], 0x55d6428c0890 /* 58 vars */) = 0
[pid 206699] +++ exited with 0 +++
[pid 206682] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206699, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid 206682] +++ exited with 2 +++
[pid 206681] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=206682, si_uid=1000, si_status=2, si_utime=0, si_stime=0} ---
Waiting...
[pid 206681] +++ exited with 0 +++
[pid 206584] +++ exited with 0 +++
[pid 206579] +++ exited with 0 +++
[pid 206581] +++ exited with 0 +++
[pid 206580] +++ exited with 0 +++
[pid 206582] +++ exited with 0 +++
[pid 206583] +++ exited with 0 +++
[pid 206538] +++ exited with 0 +++
[pid 206539] +++ exited with 0 +++
[pid 206531] +++ exited with 0 +++
[pid 206537] +++ exited with 0 +++
[pid 206535] +++ exited with 0 +++
[pid 206534] +++ exited with 0 +++
[pid 206533] +++ exited with 0 +++
[pid 206532] +++ exited with 0 +++
[pid 206536] +++ exited with 0 +++
+++ exited with 0 +++
~ 11s
Looks like the temporary script is removed immediately after launching kgx, before pkexec can execute it.
Possible cause
terminal-helper appears to assume that:
kgx --wait -- command
blocks until the command has completed, but the cleanup step runs immediately.
This causes the generated temporary script to be deleted before it is consumed.
Environment
- OS: CachyOS
- Desktop: GNOME
- Terminal emulator: GNOME Console (
kgx) - Package:
cachyos-kernel-manager
Additional note
The same behavior appears to exist in cachyos-hello, which also uses a similar terminal-helper approach. This may be a shared helper issue rather than a Kernel Manager-specific problem.
- 主要言語
- C++
- スター
- 44
- フォーク
- 30
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CachyOS/kernel-manager のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
CachyOS/kernel-manager#90 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
CachyOS/kernel-manager#78 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
CachyOS/kernel-manager#70 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
CachyOS/kernel-manager#63 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
CachyOS/kernel-manager#43 · コメント 1 件 ·
CachyOS/kernel-manager の issue をすべて見る
似ている issue
-
prio:medium status:idea type:feat
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
tests
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
kind/bug needs-sig needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
drogonframework/drogon#2605 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
ArthurSonzogni/FTXUI#1363 ·