Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the sighandler in MainUI #1193

Merged
merged 3 commits into from
Dec 12, 2023
Merged

Fix the sighandler in MainUI #1193

merged 3 commits into from
Dec 12, 2023

Conversation

tGecko
Copy link
Member

@tGecko tGecko commented Oct 15, 2023

MainUI patched to react to SIGTERM signal.

A sighandler to break out of the main loop was incorrectly implemented, set up to act on SIGKILL (9) which is not possible, as SIGKILL will always kill and leave the process no time to react.

image

The sighandler simply sets a value which is checked early in the main while(true) loop

This allows us to shut down MainUI gracefully by sending SIGTERM instead of SIGKILL which can cause all sorts of troubles, notably black screens.

This includes the patches from #1179 and thus should be merged after #1179

@tGecko tGecko added the MainUI Concern MainUI from Miyoo label Oct 15, 2023
@tGecko tGecko added this to the v4.3 milestone Oct 15, 2023
@tGecko tGecko self-assigned this Oct 15, 2023
@tGecko tGecko changed the title patch sighandler to react on SIGTERM Fix the sighandler in MainUI Oct 15, 2023
tGecko added a commit that referenced this pull request Oct 18, 2023
fix no sound in tweaks
add updated mainui binaries (same as #1193)
github-merge-queue bot pushed a commit that referenced this pull request Dec 11, 2023
## Needs to be merged after Mainui sig handling #1193 as it uses -2, and
#1299 unless rebased after this merges (as the NUM_TOOLS needs to be
updated)

- Tested on MM+ FW 0628, MM 1027, MM 0611
- Tested with Sandisk Ultra cards

## Adds a tool to sort the Apps list A-Z or Z-A based on their
config.json LABEL.

- Will add 2 tools to the Tweaks -> Tools menu
Copy link
Member

@schmurtzm schmurtzm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive hack.
The extra delay for the graceful sigterm will have to be carefully measured.

@schmurtzm schmurtzm added this pull request to the merge queue Dec 12, 2023
Merged via the queue into main with commit 68211eb Dec 12, 2023
2 checks passed
@schmurtzm schmurtzm deleted the mainuipatches-sigterm branch December 12, 2023 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MainUI Concern MainUI from Miyoo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants