# Having trouble running Logstash as a service

**URL:** https://discuss.elastic.co/t/having-trouble-running-logstash-as-a-service/79314
**Category:** Logstash
**Created:** [March 20, 2017, 9:06pm UTC](https://discuss.elastic.co/t/having-trouble-running-logstash-as-a-service/79314 "2017-03-20T21:06:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jcannell](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@jcannell](https://discuss.elastic.co/u/jcannell)
#### Post date: [March 20, 2017, 9:06pm UTC](https://discuss.elastic.co/t/having-trouble-running-logstash-as-a-service/79314/1 "2017-03-20T21:06:53Z")

</div>

Hello,

I've been experimenting with logstash for a little bit now but mostly from command line. I've had trouble getting it working properly when run as a service.

Using logstash 2.3.4 install via rpm.

sudo service logstash configtest - \> Configuration OK

I start the service, nothing ever outputs to /var/log/logstash/logstash.log

I did see this thread [LogStash 2.2 start as a service does not read config file](https://discuss.elastic.co/t/logstash-2-2-start-as-a-service-does-not-read-config-file/43675)

Seems like going to the logstash.log is the way to go, but mine never becomes populated.

Trying to figure out how to troubleshoot this issue. Thank you.

---

<div class="post-metadata">

### Author: ![jcannell](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@jcannell](https://discuss.elastic.co/u/jcannell)
#### Post date: [March 21, 2017, 1:03pm UTC](https://discuss.elastic.co/t/having-trouble-running-logstash-as-a-service/79314/2 "2017-03-21T13:03:17Z")

</div>

Just to provide more details on what I have tried so far..

1. Running service as user logstash

2. Add "--verbose" option in LS\_OPTS within /etc/init.d/logstash

3. Verified service was running using "ps -ef | grep logstash". Command line below:  
logstash 4643 1 0 12:55 pts/1 00:00:00 bash /opt/logstash/vendor/jruby/bin/jruby --1.9 -J-XX:+UseParNewGC -J-XX:+UseConcMarkSweepGC -J-Djava.awt.headless=true -J-XX:CMSInitiatingOccupancyFraction=75 -J-XX:+UseCMSInitiatingOccupancyOnly -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.io.tmpdir=/var/lib/logstas -J-Xmx1g -J-XX:HeapDumpPath=/opt/logstash/heapdump.hprof /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log --verbose

4. Changed permissions (using chmod -R for recursive) to logstash:logstash on the following directory structures:  
/opt/logstash  
/etc/logstash  
/var/lib/logstash  
/var/log/logstash

5. I run ls -al /var/log/logstash while the service is running, it seems like nothing is ever outputted to these logs? Their sizes are always zero.  
total 4  
drwxrwxr-x 2 logstash logstash 66 Mar 20 20:59 .  
drwxr-xr-x. 8 root root 4096 Mar 20 17:59 ..  
-rw-r--r-- 1 logstash logstash 0 Mar 21 12:55 logstash.err  
-rw-r--r-- 1 logstash logstash 0 Mar 20 20:59 logstash.log  
-rw-r--r-- 1 logstash logstash 0 Mar 21 12:55 logstash.stdout

I certainly appreciate any help.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 18, 2017, 1:03pm UTC](https://discuss.elastic.co/t/having-trouble-running-logstash-as-a-service/79314/3 "2017-04-18T13:03:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
