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

systemd.service's TimeoutStopSec attribute is set to infinityshould be still 0 #146

Open
andsel opened this issue Aug 10, 2020 · 2 comments

Comments

@andsel
Copy link

andsel commented Aug 10, 2020

From systemd version 229 TimeoutStopSec switched from accepting 0 with the meaning turn off to infinity, however looking in changelog https://github.com/systemd/systemd/blob/a8c9824d2a98116cbd6e5689355894158eb73a57/NEWS#L5266-L5270 the 0 value is still accepted for backward compatibility. Some distributions like centos-7, could have the old version and setting it to infinity simply doesn't work as expected.

@juan-domenech
Copy link

+1 on this one.
Confirmed that Logstash 7.10 under Centos-7 Systemd shuts down immediately after stop command, leaving the service as failed and might cause data loss.

[root@testbox ~]# systemctl stop logstash
[root@testbox ~]# systemctl status logstash
● logstash.service - logstash
   Loaded: loaded (/etc/systemd/system/logstash.service; disabled; vendor preset: disabled)
   Active: failed (Result: signal) since Tue 2021-01-05 14:29:47 UTC; 1s ago
  Process: 347844 ExecStart=/usr/share/logstash/bin/logstash --path.settings /etc/logstash --log.level trace (code=killed, signal=KILL)
 Main PID: 347844 (code=killed, signal=KILL)
Jan 05 14:29:06 testbox systemd[1]: Started logstash.
Jan 05 14:29:47 testbox systemd[1]: Stopping logstash...
Jan 05 14:29:47 testbox systemd[1]: logstash.service stop-sigterm timed out. Killing.
Jan 05 14:29:47 testbox systemd[1]: logstash.service still around after SIGKILL. Ignoring.
Jan 05 14:29:47 testbox systemd[1]: logstash.service: main process exited, code=killed, status=9/KILL
Jan 05 14:29:47 testbox systemd[1]: Stopped logstash.
Jan 05 14:29:47 testbox systemd[1]: Unit logstash.service entered failed state.
Jan 05 14:29:47 testbox systemd[1]: logstash.service failed.

@juan-domenech
Copy link

As workaround I'm commenting out #TimeoutStopSec=infinity in /etc/systemd/system/logstash.service to use default settings.
This gives time to Logstash to shutdown gracefully.

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