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

[remux] try stopping apps with SIGTERM before SIGKILL #79

Open
mrichards42 opened this issue Feb 4, 2021 · 5 comments
Open

[remux] try stopping apps with SIGTERM before SIGKILL #79

mrichards42 opened this issue Feb 4, 2021 · 5 comments

Comments

@mrichards42
Copy link
Collaborator

I'm hoping to add some cleanup code in remarkable_puzzles (like saving the current puzzle state before exit). Currently it looks like the "kill" button in remux uses SIGKILL, which is impossible to handle. It looks like oxide tries SIGTERM 5 times before giving up and sending SIGTERM.

@raisjn
Copy link
Member

raisjn commented Feb 4, 2021

the reason for SIGTERM is that the flow is:

  • pause all apps with SIGSTOP
  • show remux
  • kill app sends -9. if kill doesn't send -9, then process won't exit until SIGCONT is sent.

if we change to using SIGTERM, then it would look like:

  • pause all apps
  • show remux
  • send SIGTERM
  • send SIGCONT
  • loop and then send SIGKILL

the problem i was trying to avoid is a misbehaving app drawing to the screen after it is killed, but maybe the solution is to then do:

  • pause all apps
  • A) show remux (screenshot happens here)
  • send SIGTERM
  • send SIGCONT
  • loop and make sure dead
  • restore screenshot from (A)

(i'm pretty sure i asked Eeems about this in the past and the screenshot was one solution)

@mrichards42
Copy link
Collaborator Author

Ah, got it that makes sense. I'm just looking for some signal I can catch when the process is either suspended or killed, although now that I think about it, this is probably a broader launcher conversation since it would be nice if all the launchers used a similar process for suspending or killing.

@raisjn
Copy link
Member

raisjn commented Feb 4, 2021

killing only happens when you click the memory button to kill the app, so i'm not sure this is where we want to install the event. suspending seems like a better place to put it (esp. since you need to go suspend state to show remux in the first place).

agree that talking to other launcher devs make sense and i'm open for proposals on how to notify apps of suspend events (as long as the behavior won't be too wonky)

@raisjn
Copy link
Member

raisjn commented Feb 14, 2021

SIGTSTP is used for interactive programs (^Z), but isn't working with an immediate swap for SIGSTOP

@raisjn
Copy link
Member

raisjn commented Mar 5, 2021

i want to re-visit getting SIGTSTP to work because it's catchable

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

No branches or pull requests

2 participants