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 SIGTERM behavior that causes systemd control of etserver to timeout. #554

Merged
merged 1 commit into from Dec 19, 2022

Conversation

jshort
Copy link
Collaborator

@jshort jshort commented Dec 16, 2022

From various user reports, systemctl stop et hangs and times out
requiring a SIGKILL signal. In addition to adding the hook to kill
sentry/telemetry on SIGTERM, we need to exit as well.

Fixes #546

@jshort
Copy link
Collaborator Author

jshort commented Dec 16, 2022

 ❯ ps -ef | grep etserver                                                                                                                                                                                            09:43:43  12.16.22
root     1161316       1  0 Dec15 ?        00:02:20 /usr/bin/etserver --cfgfile=/etc/et.cfg
 ✔  ⚙  jwshort@host  ~/git/EternalTerminal/build   etserver_sigterm_fix 
 ❯ sudo systemctl status et                                                                                                                                                                                          09:43:48  12.16.22
● et.service - Eternal Terminal
     Loaded: loaded (/usr/lib/systemd/system/et.service; enabled; preset: disabled)
    Drop-In: /etc/systemd/system/et.service.d
             └─execwall.conf, restart-on-failure.conf
     Active: active (running) since Thu 2022-12-15 16:24:08 PST; 17h ago
   Main PID: 1161316 (etserver)
         IO: 56.0K read, 116.0K written
      Tasks: 11
     Memory: 1.3M
        CPU: 2min 20.417s
     CGroup: /system.slice/et.service
             └─1161316 /usr/bin/etserver --cfgfile=/etc/et.cfg

Notice: journal has been rotated since unit was started, output may be incomplete.
 ✔  ⚙  jwshort@host  ~/git/EternalTerminal/build   etserver_sigterm_fix 
 ❯ sudo systemctl stop et                                                                                                                                                                                            09:43:59  12.16.22
 ✔  ⚙  jwshort@host  ~/git/EternalTerminal/build   etserver_sigterm_fix 
 ❯ ps -ef | grep etserver                                                                                                                                                                                            09:44:08  12.16.22
 ✔  ⚙  jwshort@host  ~/git/EternalTerminal/build   etserver_sigterm_fix 
 ❯ sudo systemctl status et                                                                                                                                                                                          09:44:09  12.16.22
× et.service - Eternal Terminal
     Loaded: loaded (/usr/lib/systemd/system/et.service; enabled; preset: disabled)
    Drop-In: /etc/systemd/system/et.service.d
             └─execwall.conf, restart-on-failure.conf
     Active: failed (Result: exit-code) since Fri 2022-12-16 09:44:08 PST; 5s ago
   Duration: 17h 19min 58.850s
    Process: 1161316 ExecStart=/usr/bin/etserver --cfgfile=/etc/et.cfg (code=exited, status=15)
   Main PID: 1161316 (code=exited, status=15)
         IO: 56.0K read, 116.0K written
        CPU: 2min 20.441s

Dec 16 09:44:07 host systemd[1]: Stopping et.service - Eternal Terminal...
Dec 16 09:44:08 host etserver[1161316]: Got interrupt (perhaps ctrl+c?).  Exiting.
Dec 16 09:44:08 host systemd[1]: et.service: Main process exited, code=exited, status=15/n/a
Dec 16 09:44:08 host systemd[1]: et.service: Failed with result 'exit-code'.
Dec 16 09:44:08 host systemd[1]: Stopped et.service - Eternal Terminal.
Dec 16 09:44:08 host systemd[1]: et.service: Consumed 2min 20.441s CPU time, read 56.0K from disk, written 116.0K to disk.
Notice: journal has been rotated since unit was started, output may be incomplete.

@jshort jshort force-pushed the etserver_sigterm_fix branch 3 times, most recently from 60396d4 to 0f8900e Compare December 16, 2022 19:09
From various user reports, `systemctl stop et` hangs and times out
requiring a SIGKILL signal. In addition to adding the hook to kill
sentry/telemetry on SIGTERM, we need to exit as well.

Fixes MisterTea#546
@MisterTea
Copy link
Owner

Nice fix!

@jshort jshort merged commit c31f3b9 into MisterTea:master Dec 19, 2022
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

Successfully merging this pull request may close these issues.

etserver blocks shutdown
2 participants