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
Merged

Quit instead of shutdown on signals #15776

merged 1 commit into from
Mar 20, 2019

Conversation

yol
Copy link
Member

@yol yol 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

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.
@yol yol self-assigned this Mar 19, 2019
@yol yol requested review from Memphiz and MilhouseVH March 19, 2019 18:34
@MilhouseVH
Copy link
Contributor

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.

Copy link
Member

@Memphiz Memphiz left a comment

Choose a reason for hiding this comment

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

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

@yol
Copy link
Member Author

yol 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)

@yol yol merged commit b0e84f1 into xbmc:master Mar 20, 2019
@yol yol deleted the posix-signal-quit branch March 20, 2019 07:03
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants