title: Filebeat service hangs on restart
body: <p>I have some weird problem with <code>filebeat</code></p>
  
  <p>I am using cloud formation to run my stack, and a part of that i am installing and running <code>filebeat</code> for log aggregation, </p>
  
  <p>I inject the <code>/etc/filebeat/filebeat.yml</code> into the machine and then i need to restart <code>filebeat</code>.</p>
  
  <p>The problem is that <code>filebeat</code> hangs. and the entire provisioning is stuck (note that if i ssh into the machine and issue the "<code>sudo service filebeat restart</code> myself, the entire provisioning becomes unstuck and continues). I tried restarting it both via the <code>services</code> section and the <code>commands</code> section of the cloudformation::init and they both hang. </p>
  
  <p>I havent tried it via the <code>userdata</code> but thats the worst possible solution for it. </p>
  
  <p>Any ideas why?</p>
  
  <p>snippets for the template. both these hang as mentioned.</p>
  
  <blockquote>
  <pre><code>"commands" : {
            "01" : {
              "command" : "sudo service filebeat restart",
              "cwd" : "~",
              "ignoreErrors" : "false"
            }
  }
  </code></pre>
  </blockquote>
  
  <pre><code>"services" : {
            "sysvinit" : {
              "filebeat" : {
                "enabled" : "true",
                "ensureRunning" : "true",
                "files" : ["/etc/filebeat/filebeat.yml"]
              }
            }
          }
  </code></pre>