Logstash not working when run as service
<p>I am trying to run logstash on my Debian machine. The config file is simple for testing purposes:</p>

<pre><code>input {  
    stdin {}
}

output 
{
    file {
        path =&gt; "/tmp/test_logstash"
    }
}
</code></pre>

<p>When I run the command <code>sudo /etc/init.d/logstash start</code> I get the output <code>logstash started</code>.</p>

<p>Now I type some sample input in my command line such as <code>ls -lah</code>, which should be written to <code>/tmp/test_logstash</code> as configured in the config file.</p>

<p>But the nothing is written and when I ask about the status of logstash I get the output <code>logstash is not running</code>.</p>

<p>All log files in <code>/var/log/logstash</code> are empty files.</p>

<p>When I run <code>/opt/logstash/bin/logstash -f /etc/logstash/conf.d</code> everything works fine, but I need to run it as a service in the background.</p>

<p>I am new to using logstash and maybe it's something very easy to solve but I couldn't find any solution yet.</p>

<p>It would be great if someone has a solution for this.</p>

<p>EDIT:
Background is that I want to install and start logstash in an ansible playbook <code>/opt/logstash/bin/logstash -f /path/to/config</code> the playbook hangs in there as it is waiting for the command to be finished (wich will not be the case, because you have to quit logstash with ctrl + d then). Maybe there is an easier solution for that.</p>

<p>EDIT 2:
The owner of <code>/opt/logstash</code> directory is the user logstash with group logstash. The init.d startup script for logstash is simply:</p>

<pre><code>#!/bin/bash
/opt/logstash/bin/logstash -f /etc/logstash/conf.d
</code></pre>

<p>Thanks in advance.</p>