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

Running on eglfs platform breaks Ctrl+C and SIGTERM to quit gracefully #1496

Open
Dregu opened this issue Dec 28, 2024 · 0 comments
Open

Running on eglfs platform breaks Ctrl+C and SIGTERM to quit gracefully #1496

Dregu opened this issue Dec 28, 2024 · 0 comments

Comments

@Dregu
Copy link

Dregu commented Dec 28, 2024

Describe the bug
Running moonlight-qt --platform eglfs stream ... from systemd doesn't make the process exit gracefully with the default systemd KillSignal=SIGTERM, but SIGKILL has to be used. Also the process doesn't respond to Ctrl+C when ran over ssh. Only way to quit gracefully and make use of the --quit-after option is by pressing Ctrl+Alt+Shift+Q, but this is no good for any kind of automation on embedded devices. Forcing the process to close using SIGKILL doesn't respect --quit-after and leaves apps in paused state on host.

On wayland and xorg Ctrl+C and killall moonlight work as expected, triggering the quit segue.

Steps to reproduce

  • Have Raspberry Pi 4
  • Run moonlight-qt --platform eglfs stream ... in tty1 or over ssh
  • killall moonlight-qt or Ctrl+C don't do anything, but killall -9 moonlight-qt is needed

Client PC details (please complete the following information)

  • OS: Raspberry Pi OS Bookworm
  • Moonlight Version: v6.1.0
  • Linux package type: Official moonlight raspbian apt repo

Additional context
I actually fixed this too, at least for my Pi. I'm not making a PR cause I have no idea what I'm doing, if this causes problems for other platforms or if this is even the right thing to do. This does however fix Ctrl+C over ssh and makes stopping the systemd service quit the session gracefully, with --quit-after applied.

void signal_handler(int) {
    SDL_Event event;
    event.type = SDL_QUIT;
    event.quit.timestamp = SDL_GetTicks();
    SDL_PushEvent(&event);
}

bool Session::initialize()
{

    // ...

    // Add signal handlers that something messed up above or didn't create at all
    signal(SIGINT, signal_handler);
    signal(SIGTERM, signal_handler);

    return true;
}
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

1 participant