cachyos-kernel-manager fails to execute kernel operations because temporary script is deleted before pkexec runs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 70/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- desktop, operating-systems
Hướng nghiên cứu
Bắt đầu từ entry point của terminal-helper được hiển thị trong trace, đặc biệt là chuỗi thao tác tạo script tạm thời, khởi chạy kgx và pkexec, rồi xóa script. Tái hiện việc cài đặt hoặc gỡ kernel và xác minh rằng script vẫn tồn tại khi lệnh root chạy, thao tác pacman hoàn tất và việc dọn dẹp diễn ra sau đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 44
- Fork
- 30
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CachyOS/kernel-manager
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
CachyOS/kernel-manager#90 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
CachyOS/kernel-manager#78 ·
-
Unpatched Base KernelsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
CachyOS/kernel-manager#70 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
CachyOS/kernel-manager#63 · 1 bình luận ·
-
rm: cannot remove '/home/user/.cache/cachyos-km/pkgbuilds/linux-cachyos/src/': Is a directoryĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
CachyOS/kernel-manager#43 · 1 bình luận ·
Tất cả issue của CachyOS/kernel-manager
Issue tương tự
-
[meshoptimizer] update to 1.3Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
MicroInterpreter fails to compile with -Werror=address due to &context_ in TF_LITE_ENSURE_OKĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
tensorflow/tflite-micro#3784 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agentic-workflows automation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tenstorrent/tt-metal#57946 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aristocratos/btop#1857 ·
Maintainer thường phản hồi trong vòng 3 ngày