Skip to content

fix: keep terminal helper script alive until child exits - #288

Open
alexsmolya wants to merge 1 commit into
CachyOS:developfrom
alexsmolya:fix/issue-287-terminal-script-lifetime
Open

alexsmolya wants to merge 1 commit into
CachyOS:developfrom
alexsmolya:fix/issue-287-terminal-script-lifetime

Conversation

@alexsmolya

Copy link
Copy Markdown

terminal-helper deletes the generated temporary script after the terminal launcher returns, but kgx --wait does not guarantee that delayed pkexec/bash has already consumed it. This can produce failures such as bash: /tmp/tmp...: No such file or directory.

This change:

  • gives the generated script normal cleanup ownership through an EXIT trap while preserving the child exit status;
  • keeps terminal-launch failure cleanup parent-owned;
  • leaves terminal detection/order, pkexec flow, rootshell behavior, GUI logic, and gaming package command construction unchanged;
  • adds deterministic coverage for delayed child startup, direct bash, the rootshell/fake-pkexec path, non-zero child exit, and terminal-launch failure.

The tests use harmless marker commands only; no real root, package, or system mutation is used.

Validation:

  • bash -n src/scripts/terminal-helper src/scripts/rootshell.sh tests/terminal-helper_test.sh
  • tests/terminal-helper_test.sh
  • git diff --check

Fixes #287

@alexsmolya

Copy link
Copy Markdown
Author

I'm continuing this work as a partner, not as a competitor. The existing terminal-helper fix and its investigation may provide useful evidence, so I want to preserve and validate that work rather than throw it away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cachyos-hello Gaming package installer fails because temporary script is deleted before execution

1 participant