Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init script gives error on start #87

Closed
pdeva opened this issue Jun 22, 2014 · 9 comments
Closed

init script gives error on start #87

pdeva opened this issue Jun 22, 2014 · 9 comments

Comments

@pdeva
Copy link

pdeva commented Jun 22, 2014

trying to start remote_syslogs using the init script from the examples:
(https://github.com/papertrail/remote_syslog/blob/master/examples%2Fremote_syslog.init.d)

keep getting this error.

root@mycomp:~# service remote_syslog start
Starting remote_syslog: /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find servolux (>= 0) amongst [remote_syslog-1.6.14] (Gem::LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/specification.rb:777:in `block in activate_dependencies'
        from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `each'
        from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
        from /usr/lib/ruby/1.9.1/rubygems/specification.rb:750:in `activate'
        from /usr/lib/ruby/1.9.1/rubygems.rb:1232:in `gem'
        from /usr/local/bin/remote_syslog:22:in `<main>'

If i just run directly from the command line, it works fine:

root@mycomp:~# remote_syslog
Watching 1 files/globs. Sending to logs.papertrailapp.com:12345 (UDP).
@troy
Copy link
Contributor

troy commented Jun 22, 2014

Are you using rvm, rbenv, or another ruby VM manager which might lead to
different rubies being used? I suspect that the init script is running with
one ruby and your interactive shell is using another (which has the gem
installed and thus the decencies).

On Saturday, June 21, 2014, pdeva notifications@github.com wrote:

trying to start remote_syslogs using the init script from the examples:
(
https://github.com/papertrail/remote_syslog/blob/master/examples%2Fremote_syslog.init.d
)

keep getting this error.

root@mycomp:~# service remote_syslog start
Starting remote_syslog: /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find servolux (>= 0) amongst [remote_syslog-1.6.14] (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/specification.rb:777:inblock in activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in each' from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:inactivate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:750:in activate' from /usr/lib/ruby/1.9.1/rubygems.rb:1232:ingem'
from /usr/local/bin/remote_syslog:22:in `

'

If i just run directly from the command line, it works fine:

root@mycomp:~# remote_syslog
Watching 1 files/globs. Sending to logs.papertrailapp.com:12345 (UDP).


Reply to this email directly or view it on GitHub
#87.

@troy
Copy link
Contributor

troy commented Jun 22, 2014

".. thus the dependencies."

@pdeva
Copy link
Author

pdeva commented Jun 22, 2014

doing a ruby -v gives me this:

root@mycomp:~# ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

I am not familiar at all with ruby so i dont know how to make the init script use the right version.
could you explain how to?

@pdeva
Copy link
Author

pdeva commented Jun 22, 2014

Are you using rvm, rbenv, or another ruby VM manager which might lead to
different rubies being used?

No. i only built a fresh image of ubuntu 14.04 and installed 'ruby-full' and 'ruby' packages as recommended here:
http://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-text-log-files-in-unix

@troy
Copy link
Contributor

troy commented Jun 22, 2014

If you aren't familiar with Ruby, grab remote_syslog2 instead of remote_syslog (this app). It's a standalone binary which doesn't depend on an interpreter, aside from many other fixes.

remote_syslog2 is gradually replacing remote_syslog entirely, though we'll continue to support the original for existing installations.

@pdeva
Copy link
Author

pdeva commented Jun 25, 2014

we dont want to use the remote_syslog2 since it doesnt support watching directories at the moment.
can you tell us how to get this version working?

@troy
Copy link
Contributor

troy commented Jun 25, 2014

Sure. I suspect right now, when you run ruby -v, your shell uses one ruby installation. When root does so during boot, it's using a different ruby installation.

The first step is to see which of rbenv or rvm you're using. Try:

locate rbenv
locate rvm

and see what turns up. You can also try running rvm and rbenv at the command line and see which one is found.

Once you know which one is found, reply here and I'll give you a couple links with examples how to use it from init scripts. Thanks for reminding me why we rewrote remote_syslog in something other than Ruby, too ;-)

@pdeva
Copy link
Author

pdeva commented Jun 28, 2014

This is the output for the various commands:

root@dc1:~# locate rbenv
root@dc1:~# locate rvm
/lib/modules/3.13.0-24-generic/kernel/drivers/video/vermilion/crvml.ko
/usr/lib/ruby/1.9.1/drb/extservm.rb
root@dc1:~# rvm
No command 'rvm' found, but there are 20 similar ones
rvm: command not found
root@dc1:~# rbenv
The program 'rbenv' is currently not installed. You can install it by typing:
apt-get install rbenv
root@dc1:~#

Please tell next steps

@troy
Copy link
Contributor

troy commented Jun 29, 2014

I'm out of idea without having access to the system. If you're a Papertrail customer, can you email support at papertrailapp.com (or hit Help -> Ask a Question in Papertrail)? I'd be happy to provide support for your specific environment as part of your Papertrail service, and since this isn't an issue with the code or app, we'll be able to provide better service there.

@troy troy closed this as completed Jun 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants