Hi!
I would like ask question about the file input for ver 5.0.0-alpha4.
Problem
I just upgraded logstash from 2.3.3 to 5.0.0-alpha4 using yum update.
However , file input for /var/log/message fails due to file permission error.
{:timestamp=>"2016-07-08T15:06:00.969000+0900", :message=>"Pipeline main started"}
{:timestamp=>"2016-07-08T15:11:01.214000+0900", :message=>"failed to open /var/log/yum.log: Permission denied - /var/log/yum.log", :level=>:warn}
{:timestamp=>"2016-07-08T15:11:01.215000+0900", :message=>"failed to open /var/log/messages: Permission denied - /var/log/messages", :level=>:warn}
Analysis
I have set up LS_USER in /etc/sysconfig/logstash but the user of the process is logstash.
[root@ip-172-30-1-196 logstash]# cat /etc/sysconfig/logstash
###############################
# Default settings for logstash
###############################
# Override Java location
#JAVACMD=/usr/bin/java
# Set a home directory
#LS_HOME=/var/lib/logstash
# Arguments to pass to logstash agent
#LS_OPTS=""
# Arguments to pass to java
#LS_HEAP_SIZE="1g"
#LS_JAVA_OPTS="-Djava.io.tmpdir=$HOME"
# pidfiles aren't used for upstart; this is for sysv users.
#LS_PIDFILE=/var/run/logstash.pid
# user id to be invoked as; for upstart: edit /etc/init/logstash.conf
#LS_USER=logstash
LS_USER=root
# logstash logging
#LS_LOG_FILE=/var/log/logstash/logstash.log
#LS_USE_GC_LOGGING="true"
#LS_GC_LOG_FILE=/var/log/logstash/gc.log
# logstash configuration directory
#LS_CONF_DIR=/etc/logstash/conf.d
# Open file limit; cannot be overridden in upstart
#LS_OPEN_FILES=16384
# Nice level
#LS_NICE=19
# If this is set to 1, then when `stop` is called, if the process has
# not exited within a reasonable time, SIGKILL will be sent next.
# The default behavior is to simply log a message "program stop failed; still running"
#KILL_ON_STOP_TIMEOUT=0
[root@ip-172-30-1-196 logstash]# ps -eF | grep logstash
logstash 12339 1 2 916386 468516 0 15:05 ? 00:01:09 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms256m -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main --1.9 /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb --path.settings /etc/logstash
root 12999 12895 0 28161 956 1 16:01 pts/0 00:00:00 grep --color=auto logstash
SInce the default permission is 600 , logstash fails to access the file.
[root@ip-172-30-1-196 logstash]# ls -ltr /var/log/messages
-rw-------. 1 root root 24178653 Jul 8 16:03 /var/log/messages
It looks like logstash is ignoring the LS_USER
option.
Question
Is there any other option to start the logstash as root user?
Thanks,
Yu Watanabe