Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 598422

Summary: app-admin/logstash-bin-5.0.0 initscript faulty
Product: Gentoo Linux Reporter: Thomas Stein <himbeere>
Component: Current packagesAssignee: Patrick Lauer <patrick>
Status: RESOLVED FIXED    
Severity: normal CC: erkiferenc, hydrapolic, proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Service file for systemd

Description Thomas Stein 2016-10-29 09:28:23 UTC
Hello Devs.

When i try to start logstash-bin-5.0.0 i get:

 * Checking your configuration ...
ERROR: Unrecognised option '--config'

See: 'bin/logstash --help'
 * Configuration error. Please fix your configuration files.                                                         [ !! ]
 * ERROR: logstash failed to start

I suppose the initscript needs to be adjusted for 5.0.0 but there is no adjusted initfile provided. Would be cool to have that fixed.

thanks and cheers
t.

Reproducible: Always
Comment 1 Patrick Lauer gentoo-dev 2016-10-29 09:57:31 UTC
Oh dear :)

I've fixed that and two similar syntax changes in 5.0.0-r1
Comment 2 Thomas Stein 2016-10-29 10:13:20 UTC
:-) Thanks. Will test it today. While you are at it. Elasticsearch initscript 5.0.0 seems to be broken too. Should i file another bug report?

cheers
t.
Comment 3 Thomas Stein 2016-10-29 11:25:08 UTC
Hello Patrick.

Thanks for the updated initscript. The error message is gone but now logstash does not like the LS_LOG_FILE variable. It seems it has to be a directory now. After adjusting that logstash still does not start. It just hangs there when i issue the command /etc/init.d/logstash start. Nothing in the logs. 

cheers
t.
Comment 4 Mike Lothian 2016-11-01 11:45:10 UTC
Created attachment 452074 [details]
Service file for systemd

Any chance you could add in a service file for systemd too? I've got a basic one working here, unfortunately sysv integration can't be enabled yet in systemd on Gentoo
Comment 5 Thomas Stein 2016-11-02 14:28:24 UTC
Hello Devs.

Call me stupid but i still get errors when starting logstash.

serve ~ # /etc/init.d/logstash start
 * Caching service dependencies ...                                                                                              [ ok ]
 * Checking your configuration ...
2016-11-02 15:08:56,135 main ERROR Unable to create file /var/log/logstash/logstash.log/logstash-plain.log java.io.IOException: Not a directory
	at java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.io.File.createNewFile(File.java:1012)
	at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:421)
	at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:403)
	at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:73)

thanks and cheers
t.
Comment 6 Thomas Stein 2016-11-07 07:28:59 UTC
Hi Devs.

Just for the record. Logstash starts fine with this adjustments:

--- /usr/portage/app-admin/logstash-bin/files/logstash.initd3	2016-10-29 11:56:40.000000000 +0200
+++ /etc/init.d/logstash	2016-11-04 10:33:36.025504610 +0100
@@ -4,7 +4,7 @@
 
 LS_USER=${LS_USER:-logstash}
 LS_GROUP=${LS_GROUP:-$LS_USER}
-LS_LOG_FILE=${LS_LOG_FILE:-/var/log/logstash/logstash.log}
+LS_LOG_DIR=${LS_LOG_DIR:-/var/log/logstash}
 LS_CONF_DIR=${LS_CONF_DIR:-/etc/logstash/conf.d}
 LS_HOME=${LS_HOME:-/var/lib/logstash}
 LS_HEAP_SIZE=${LS_HEAP_SIZE:-500m}
@@ -15,7 +15,7 @@
 KILL_ON_STOP_TIMEOUT=${KILL_ON_STOP_TIMEOUT:-0}
 
 command="/opt/logstash/bin/logstash"
-command_args="--path.config ${LS_CONF_DIR} --path.logs ${LS_LOG_FILE} ${LS_OPTS}"
+command_args="--path.config ${LS_CONF_DIR} --path.logs ${LS_LOG_DIR} ${LS_OPTS}"
 command_background="true"
 pidfile=${LS_PIDFILE:-"/run/logstash/logstash.pid"}
 
@@ -53,8 +53,7 @@
 	rc_ulimit="-n ${LS_OPEN_FILES}"
 
 	checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${pidfile}")"
-	checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${LS_LOG_FILE}")"
-	checkpath -f -o "${LS_USER}":"${LS_GROUP}" -m640 "${LS_LOG_FILE}"
+	checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${LS_LOG_DIR}")"
 }
 
 stop() {
Comment 7 Thomas Stein 2016-11-08 12:47:10 UTC
Better like that:

--- /usr/portage/app-admin/logstash-bin/files/logstash.initd3	2016-10-29 11:56:40.000000000 +0200
+++ /etc/init.d/logstash	2016-11-08 13:29:04.550332640 +0100
@@ -4,7 +4,7 @@
 
 LS_USER=${LS_USER:-logstash}
 LS_GROUP=${LS_GROUP:-$LS_USER}
-LS_LOG_FILE=${LS_LOG_FILE:-/var/log/logstash/logstash.log}
+LS_LOG_DIR=${LS_LOG_DIR:-/var/log/logstash}
 LS_CONF_DIR=${LS_CONF_DIR:-/etc/logstash/conf.d}
 LS_HOME=${LS_HOME:-/var/lib/logstash}
 LS_HEAP_SIZE=${LS_HEAP_SIZE:-500m}
@@ -15,7 +15,7 @@
 KILL_ON_STOP_TIMEOUT=${KILL_ON_STOP_TIMEOUT:-0}
 
 command="/opt/logstash/bin/logstash"
-command_args="--path.config ${LS_CONF_DIR} --path.logs ${LS_LOG_FILE} ${LS_OPTS}"
+command_args="--path.config ${LS_CONF_DIR} --path.logs ${LS_LOG_DIR} ${LS_OPTS}"
 command_background="true"
 pidfile=${LS_PIDFILE:-"/run/logstash/logstash.pid"}
 
@@ -53,8 +53,7 @@
 	rc_ulimit="-n ${LS_OPEN_FILES}"
 
 	checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${pidfile}")"
-	checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${LS_LOG_FILE}")"
-	checkpath -f -o "${LS_USER}":"${LS_GROUP}" -m640 "${LS_LOG_FILE}"
+	checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "${LS_LOG_DIR}"
 }
 
 stop() {
Comment 8 Tomáš Mózes 2016-12-07 01:35:56 UTC
Patrick, can you please fix this?
Comment 9 Tomáš Mózes 2016-12-18 13:23:31 UTC
https://github.com/gentoo/gentoo/pull/3160
Comment 10 Michael Palimaka (kensington) gentoo-dev 2016-12-18 14:20:55 UTC
Fixed in git by Tomáš.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab586eb83c097cf29b13f5cb927eb2443c92ecb1