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

Quit instead of shutdown on signals #15776

Merged
merged 1 commit into from Mar 20, 2019

Conversation

@pkerling
Copy link
Member

commented Mar 19, 2019

TMSG_QUIT was indavertently changed to TMSG_SHUTDOWN when the signal
handling was modified. Change back to TMSG_QUIT - the application should
not cause the machine to power down upon receipt of SIGINT or SIGTERM
after all.

Slipped through in #15730 unfortunately

[posix] Quit instead of shutdown on signals
TMSG_QUIT was indavertently changed to TMSG_SHUTDOWN when the signal
handling was modified. Change back to TMSG_QUIT - the application should
not cause the machine to power down upon receipt of SIGINT or SIGTERM
after all.
@MilhouseVH

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

I ran some tests in LibreELEC (without our SIGTERM patch) and the changes in this PR seem fine, TMSG_QUIT is much more polite than TMSG_SHUTDOWN! :)

I did briefly test if we still need our SIGTERM and I occasionally (but not always) saw this behaviour when testing this PR (without the LibreELEC SIGTERM patch):

PR15730+PR15776, without LibreELEC SIGTERM patch, systemctl stop kodi:

Mar 19 19:03:43 NUC systemd[1]: Stopping Kodi Media Center...
Mar 19 19:04:13 NUC systemd[1]: kodi.service: State 'stop-sigterm' timed out. Killing.
Mar 19 19:04:13 NUC systemd[1]: kodi.service: Killing process 1117 (kodi.sh) with signal SIGKILL.
Mar 19 19:04:13 NUC systemd[1]: kodi.service: Killing process 1121 (kodi.bin) with signal SIGKILL.
Mar 19 19:04:13 NUC systemd[1]: kodi.service: Main process exited, code=killed, status=9/KILL
Mar 19 19:04:13 NUC systemd[1]: kodi.service: Failed with result 'timeout'.
Mar 19 19:04:13 NUC systemd[1]: Stopped Kodi Media Center.

In this case kodi.bin would have been killed, without saving guisettings.xml and possibly leaving any CEC-connected devices in an unknown state.

I think the purpose of our SIGTERM patch is to force the update of guisettings.xml and ensure (as much as possible) a clean CEC shutdown whenever kodi.bin is instructed to stop. I'll run more tests tomorrow with/without our SIGTERM patch, but this PR looks good to go.

@Memphiz
Copy link
Member

left a comment

Really odd. When I tested that other PR it definitly did not shutdown my computer...

@pkerling

This comment has been minimized.

Copy link
Member Author

commented Mar 20, 2019

@Memphiz My guess is that it only really shuts down in standalone mode (it didn't shut down for me either)

@pkerling pkerling merged commit b0e84f1 into xbmc:master Mar 20, 2019

1 check passed

default You're awesome. Have a cookie
Details

@pkerling pkerling deleted the pkerling:posix-signal-quit branch Mar 20, 2019

@Rechi Rechi added this to the Leia 18.2-rc1 milestone Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.