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

Configurable log location for export command #4

Closed
Iristyle opened this issue Dec 11, 2012 · 7 comments
Closed

Configurable log location for export command #4

Iristyle opened this issue Dec 11, 2012 · 7 comments

Comments

@Iristyle
Copy link
Contributor

For feature parity with the Ruby version of Foreman, it would be helpful to support a configurable -l for log location.

I'd like to switch over to your variant, since I prefer Node... but we're Capistrano deploying, and Capistrano configures log directories already, so it's nice to be able to pass that to export.

https://ddollar.github.com/foreman/#EXPORTING

You're missing a few other options there, but we don't need those at the moment.. just the log location for now ;0

Thanks!

@groundwater
Copy link
Contributor

Hey, so just to clarify you wanted to be able to set the location of the logs for the upstart job?

I can probably to that in the next few days. I agree, feature parity would be nice.

@Iristyle
Copy link
Contributor Author

Yup, upstart log location, rather than hard-coded /var/log/.

I usually prefer /var/log because this is the standard log location, but for whatever reason, Capistrano likes to create an #{app_dir}/shared/log directory and output there.

Not sure which convention I should break ;0 But parity is a good thing in any event, as noted.

Thanks!

@groundwater
Copy link
Contributor

This will also include a command by root creating and chown'ing the directory to whatever the given node user is. Would this work with Capistrano? I don't see any reason why it wouldn't, but thought I'd check.

@Iristyle
Copy link
Contributor Author

Capistrano already chmods the directory to be writable.

IMHO, Capistrano is a bit broken when it comes to setting up security properly. It kind of assumes that the SSH account that it's executing scripts from, is the same account you're using to run the application... which I don't agree with.

In my particular case, I setup a deployers group, and my deployment path is owned by the SSH user and the deployers group. The account that I'm SSHing in with is a member of deployers and has write access to the path where the files are being served from. Another app-specific lower-privileged user is also a member of deployers and has only read access to the files, except for the #{app_dir}/shared/logs, where it is allowed to write.

So based on how I have things setup, I think additionally chowning the logs dir shouldn't be an issue. But I'm not sure if this is necessarily something node-foreman should configure. I understand why you might want to do this... but I wonder if assuming that the file system should be modified like that is a good idea.

It doesn't appear that the original Ruby source makes the assumption that it should change ownership -- at least I couldn't find anything there -- https://github.com/ddollar/foreman/blob/master/lib/foreman/export/upstart.rb

@groundwater
Copy link
Contributor

They do chown the logs file, see https://github.com/ddollar/foreman/blob/master/data/export/upstart/master.conf.erb

It's part of the upstart job, node-foreman doesn't actually do it. If all else fails, you still have the option of post-processing the upstart files. It wouldn't be perfect, but it's still "automatable" if that's a word.

I'm gonna migrate this to a pull request #5

See if those changes will meet your needs.

@Iristyle
Copy link
Contributor Author

Ahh, good find -- apologies. Right you are. Missed it in the Upstart confs!

Awesome -- thanks for implementing. One step closer to pulling Ruby out of my server stacks.

@groundwater
Copy link
Contributor

Published this change in v0.0.16

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