Skip to content
This repository was archived by the owner on Oct 30, 2026. It is now read-only.

Clean up palera1n on SIGTERM and explain an unexpected Pongo - #9

Merged
henrikklee merged 2 commits into
OrchardLinux:mainfrom
dl-alexandre:palera1n-sigterm-and-hint
Oct 29, 2026
Merged

henrikklee merged 2 commits into
OrchardLinux:mainfrom
dl-alexandre:palera1n-sigterm-and-hint

Conversation

@dl-alexandre

Copy link
Copy Markdown
Contributor

Follow-up to #8, which was merged before these two commits were pushed.

Clean up the palera1n group on SIGTERM

#8 kills palera1n's process group when Orchard stops waiting because of a timeout or Ctrl-C. A plain SIGTERM (pkill orchard, closing a session, a service manager stopping it) still ended Orchard without unwinding. That left checkra1n running, which is the same orphan #8 fixes.

run_process_group now turns SIGTERM into SystemExit(143) while palera1n runs, so the existing except BaseException kills the group on the way out. The handler is installed only on the main thread (boot() runs there for both install and launch) and restored afterwards, so SIGTERM behaves as before everywhere else.

New test test_bootstrap_sigterm_stops_spawned_children: a child Python process runs run_process_group on a command that backgrounds a long-lived child, then gets SIGTERM. With the handler, it exits with 143 and the child is gone. Without the handler, the test fails (-15 != 143) and the child survives.

Explain an unexpected Pongo

When something else exploited the device, Orchard reported only Expected dfu at the selected port; found pongo. For that one DFU→Pongo case, the message now adds:

Another palera1n/checkra1n may have exploited it; stop any running, force-restart the device and enter DFU again

Other mismatches keep their current message.

Testing

The three bootstrap tests plus test_usb_readiness passed 5 out of 5 runs on top of current main.

🤖 Generated with Claude Code

dl-alexandre and others added 2 commits October 29, 2026 04:45
SIGTERM (pkill, logout) ended Orchard without unwinding, so the process
group was left running exactly as before. While palera1n runs, turn
SIGTERM into SystemExit so the group is killed on the way out. The
handler is installed only on the main thread and restored afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stray palera1n/checkra1n exploiting the device behind Orchard's back
showed up only as "Expected dfu at the selected port; found pongo".
Say what likely happened and how to recover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@henrikklee
henrikklee merged commit e8fd926 into OrchardLinux:main Oct 29, 2026
3 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants