SysVInit scripts don't touch /var/lock/subsys file - Kill scripts fail during shutdown
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 63
Description
Hi,
Firstly I should say that this is my first ever issue I've raised on GitHub, so please go easy on me :)
I've found that when using Logstash (1.4.2) in an auto-scaled Amazon EC2 environment, using the SysVInit scripts in this project, the Termination of an instance causes an ungraceful shutdown of the Logstash process, meaning that the Elasticsearch cluster that the Logstash clients had Joined previously are left to remove the terminated instance following the timeouts in the Elasticsearch Fault Detection routine.
By adding the "/var/lock/subsys/" file at service start in an init script on an Amazon Linux AMI, a subsequent instance termination does gracefully stop the Logstash process and the client node is disconnected from the Elasticsearch cluster in a clean manner.
The presence of the "/var/lock/subsys/" file seems to be a requirement for the chkconfig-generated Kill scripts to operate during instance shutdown. See https://fedoraproject.org/wiki/Packaging:SysVInitScript#Careful_Handling_of_.2Fvar.2Flock.2Fsubsys.2F.3Cservice_name.3E_mechanism
I hope this is useful!
Clive
Contributor guide
Assessment
This issue has not been assessed yet.