/etc/init.d/logstash 文件不是为 RHEL 6.8 创建的

/etc/init.d/logstash file not created for RHEL 6.8

我下载了 logstash-6.4.0.rpm 并安装了

yum install logstash-6.4.0.rpm

对于 RHEL 6.8etc/init.d/logstash

安装后,收到一条消息

Successfully created system startup script for Logstash

但是文件没有创建,它是为 SysV 自动生成的 See here

我尝试通过编辑手动生成 /etc/logstash/startup.options 添加为这样

JAVACMD=/opt/java/jdk1.8.0_111/bin/java
JAVA_HOME=/opt/java/jdk1.8.0_111

然后去了/user/share/logstash/bin和运行sudo ./system-installSaw Here

再次执行 sudo ./system-install 后收到相同的消息

Successfully created system startup script for Logstash

但是,文件仍然没有创建。知道吗,我该如何实现?

我能够生成 logstash 服务我在命令中缺少一些选项。

step 1: check where your logstash is with command whereis logstash > for me :

[root@user ~]# whereis logstash
logstash: /etc/logstash /usr/share/logstash

step 2: edit /etc/logstash/startup.options file and correct path for JAVACMD and JAVA_HOME

JAVACMD=/opt/java/jdk1.8.0_111/bin/java
JAVA_HOME=/opt/java/jdk1.8.0_111

step 3: Go to /usr/share/logstash/bin and run system-install with sudo

sudo ./system-install /etc/logstashstartup.options sysv

Result

[root@user bin]# sudo ./system-install /etc/logstash/startup.options sysv
Using provided startup.options file: /etc/logstash/startup.options
Manually creating startup for specified platform: sysv
Successfully created system startup script for Logstash