elastic / elastic/logstash

init.d's logstash configtest not consistently returning warnings

Open
#4,304 0 comments 0 reactions 0 assignees View on GitHub
bug packaging
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

Not sure if this is related to https://github.com/elastic/logstash/issues/4111, but it appears that when using the RPM installation, the configtest of the logstash init.d script is not consistently reporting warnings detected via configtest, see below:

```
[user@localhost init.d]$ sudo /etc/init.d/logstash configtest
Configuration OK
[user@localhost init.d]$ sudo /etc/init.d/logstash restart
logstash started.
[user@localhost init.d]$ sudo /etc/init.d/logstash configtest
Configuration OK
[user@localhost init.d]$ sudo /etc/init.d/logstash restart
Killing logstash (pid 24726) with SIGTERM
Waiting logstash (pid 24726) to die...
Waiting logstash (pid 24726) to die...
logstash stopped.
logstash started.
[user@localhost init.d]$ sudo /etc/init.d/logstash configtest
Configuration OK
[user@localhost init.d]$ sudo /etc/init.d/logstash stop
Killing logstash (pid 13734) with SIGTERM
Waiting logstash (pid 13734) to die...
Waiting logstash (pid 13734) to die...
logstash stopped.
[user@localhost init.d]$ sudo /etc/init.d/logstash start
logstash started.
[user@localhost init.d]$ sudo /etc/init.d/logstash status
logstash is running
[user@localhost init.d]$ sudo /etc/init.d/logstash configtest
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.PoolingHttpClientConnectionManager)
.
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Configuration OK
[user@localhost init.d]$ sudo /etc/init.d/logstash status
logstash is running
[user@localhost init.d]$ sudo /etc/init.d/logstash restart
Killing logstash (pid 27844) with SIGTERM
Waiting logstash (pid 27844) to die...
Waiting logstash (pid 27844) to die...
logstash stopped.
logstash started.
[user@localhost init.d]$ sudo /etc/init.d/logstash stop
Killing logstash (pid 1861) with SIGTERM
Waiting logstash (pid 1861) to die...
Waiting logstash (pid 1861) to die...
logstash stopped.
[user@localhost init.d]$ /opt/logstash/bin/logstash -f /etc/logstash/conf.d/ --configtest
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.PoolingHttpClientConnectionManager)
.
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Configuration OK
[user@localhost init.d]$ /opt/logstash/bin/logstash -f /etc/logstash/conf.d/ --configtest
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.PoolingHttpClientConnectionManager)
.
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Configuration OK
[user@localhost init.d]$ /opt/logstash/bin/logstash -f /etc/logstash/conf.d/ --configtest
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.PoolingHttpClientConnectionManager)
.
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Configuration OK
[user@localhost init.d]$ /opt/logstash/bin/logstash -f /etc/logstash/conf.d/ --configtest
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.PoolingHttpClientConnectionManager)
.
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Configuration OK
[user@localhost init.d]$ rpm -qa |grep -i logstash
logstash-2.1.0-1.noarch
```

There were no changes in the file that is in the /etc/logstash/conf.d folder during the test (on Centos 7). And you can see that the direct configtest call from the ./logstash script seems to consistently return the warnings unlike the init.d script.

The config folder has a single file with the following (mostly a test to cause the log4j warning as reported in #4111 to show up):

```
input{
kafka{
zk_connect=>"some_host"
group_id=>"group"
topic_id=>"topic"
}
}

output{
elasticsearch{
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.