papertrail / remote_syslog

Deprecated in favor of https://github.com/papertrail/remote_syslog2
http://help.papertrailapp.com/
MIT License
221 stars 74 forks source link

Can't seem to use relative path to ssl_server_cert #81

Open swrobel opened 10 years ago

swrobel commented 10 years ago

remote_syslog: #<Errno::ENOENT: No such file or directory @ rb_sysopen - ssl/papertrail.crt

I have the papertrail certificate in my application's code and I'm attempting to access it by giving the relative path to the file. I can't give an absolute path, since my deploy directory depends on the environment, application, etc. Anyway, hardcoding paths sucks. I think it has something to do with this comment regarding Daemonize setting the path to / https://github.com/papertrail/remote_syslog/blob/master/lib/remote_syslog/cli.rb#L171

troy commented 10 years ago

I'm actually not 100% sure that a relative path for the key won't work. Is it possible that the working directory remote_syslog was started in - that is, what ssl/ would be relative to - is not the app root (or wherever ssl/ is). Couple ideas for how to identify the working directory:

If one or more of those confirm that the wd is the directory containing ssl/, we're into other options:

swrobel commented 10 years ago

I tried your 3rd suggestion, "as a last resort, try invoking remote_syslog as a user while in the directory containing ssl/ (with the same arguments is used by the init script)."

Still get not found even when running it from within the ssl/ dir within my app simply using the following command: bundle exec remote_syslog -c ../config/remote_syslog.yml --dest-port <port> --tls

I also tried adding puts Dir.getwd in the source but it doesn't seem to get output to the command line. It also seemed to me that this was a better place to put it so I tried it there as well - no luck. I've tried adding an additional puts in cli.rb and that comes out, so it isn't that I'm modifying in the wrong gem dir or something.

troy commented 10 years ago

I'm out of easy ideas too. I had one question. You mentioned:

Still get not found even when running it from within the ssl/ dir within my app

Were you in the directory containing ssl/ or in the ssl/ directory itself? I'm guessing that it was just wording, but wanted to confirm.

swrobel commented 10 years ago

I've tried it from both

troy commented 10 years ago

Okay. If you can get it to spit out the wd, it may well be / but there's a chance it'll be something else.