logstash run from sysv init, upstart, etc, may not work

Description

I haven't reproduced this myself, but two reports say that logstash doesn't work when their startup tool does a chdir to "/" before starting logstash; the workaround is to 'cd /tmp' before starting. Kind of sucky

Needs digging.

Attachments

1

Gliffy Diagrams

Activity

Show:

Philippe Weber December 6, 2012 at 1:20 PM

As there is a cookbook recipe for upstart, I suppose it is fixed in newer version.

http://cookbook.logstash.net/recipes/using-upstart/

Please reopen if it's not the case.

Erik Redding October 11, 2012 at 12:09 AM

If you're having the issue with "no such file to load" - add:

export GEM_HOME=/var/lib/gems/1.8

or whatever your gem path (gem env) is to your init script.

This solved my issue.

Ryan Goeken June 4, 2012 at 9:14 PM

I see the same issue as Simon. When I run the .jar from the command line, everything works just fine.
When I run an init script the agent will complain about missing gems.

Here's the command line I use that works PERFECTLY:
java -jar logstash-monolithic.jar agent -f /etc/logstash/devglog01.conf

Here's the init script: http://pastebin.com/9yfqmH6E

And finally here's the error in the logs after running the init script:
LoadError: no such file to load – file:/u01/logstash/logstash-monolithic.jar!/gems/bunny-0.7.8/lib/bunny/version
require at org/jruby/RubyKernel.java:1047
require at file:/u01/logstash/logstash-monolithic.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
(root) at file:/u01/logstash/logstash-monolithic.jar!/gems/bunny-0.7.8/lib/bunny.rb:8
require at org/jruby/RubyKernel.java:1047
require at file:/u01/logstash/logstash-monolithic.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:59
require at file:/u01/logstash/logstash-monolithic.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55
register at file:/u01/logstash/logstash-monolithic.jar!/gems/bunny-0.7.8/lib/bunny.rb:86
run_input at file:/u01/logstash/logstash-monolithic.jar!/logstash/agent.rb:624
run_input at file:/u01/logstash/logstash-monolithic.jar!/logstash/agent.rb:624
start_input at file:/u01/logstash/logstash-monolithic.jar!/logstash/agent.rb:322
Exception in thread "LogStash::Agent" org.jruby.exceptions.RaiseException: (SystemExit) no such file to load – file:/u01/logstash/logstash-monolithic.jar!/gems/bunny-0.7.8/lib/bunny/version
at org.jruby.RubyThread.join(org/jruby/RubyThread.java:509)
at LogStash::Agent.wait(file:/u01/logstash/logstash-monolithic.jar!/logstash/agent.rb:312)
at logstash.runner.main(logstash/runner.rb:40)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1612)
at logstash.runner.main(logstash/runner.rb:40)
at logstash.runner.(root)(logstash/runner.rb:108)

Simon April 20, 2012 at 10:51 AM
Edited

The problem exists also in the agent if you specify "amqp" in the "input" or "output".

Garry Polley December 15, 2011 at 10:48 PM

I have been experimenting with logstash and the web service piece is the only part effected. The 'cd /tmp' work around does work. The issue is due to the environment not getting properly set. I don't know how to fix this, but it would be nice if some documentation existed for this work around, I have spent many hours trying to find out what the root cause is. I have found many places on the internet with this error, I think a fix would be greatly appreciated.

Fixed

Details

Assignee

Reporter

Fix versions

Created June 14, 2011 at 9:54 PM
Updated April 19, 2013 at 8:19 PM
Resolved December 6, 2012 at 1:20 PM