Restart init.d script fails
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 63
Description
The "restart" command in the init.d script often fails without an error.
- Version: 5.1.1
- Operating System: CentOS 6.8
- Config File: contains pipeline.unsafe_shutdown: true
- Sample Data: N/A
- Steps to Reproduce:
I removed the Upstart init script, and installed the SysV one, based on the hack in #6148, in order to comply with CentOS 6 standards.
I also created /etc/sysconfig/logstash with:
```
KILL_ON_STOP_TIMEOUT=1
JAVACMD=/usr/lib/jvm/java-1.8.0/bin/java
export JAVACMD KILL_ON_STOP_TIMEOUT
```
The service started fine, and created a file /var/run/logstash.pid with the PID, 2785.
Then I ran "sudo service logstash restart". In /var/log/messages, it said:
```
logstash is running
Attempting 'stop' on logstash
Killing logstash (pid 2785) with SIGTERM
Waiting logstash (pid 2785) to die...
Waiting logstash (pid 2785) to die...
Waiting logstash (pid 2785) to die...
Waiting logstash (pid 2785) to die...
Waiting logstash (pid 2785) to die...
Timeout reached. Killing logstash (pid 2785) with SIGKILL. This may result in data loss.
logstash killed with SIGKILL.
Attempting 'start' on logstash
logstash is already running
```
So it failed to remove the pid file (maybe related to #5183), and didn't correctly detect that it needed to start logstash again.
Contributor guide
Assessment
This issue has not been assessed yet.