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

logrotate #44

Open
mcfiredrill opened this issue Feb 24, 2017 · 0 comments
Open

logrotate #44

mcfiredrill opened this issue Feb 24, 2017 · 0 comments

Comments

@mcfiredrill
Copy link

I just wanted to mention I had a few issues with the logrotate config out of the box.
I noticed my logs wern't being rotated so I ran logrotate -d -f on the config file.
First I got an error about the ownership being wrong.

deploy@myhost://var/www/my_app/shared/config$ sudo logrotate -d -f /etc/logrotate.d/my_app_production
Ignoring /etc/logrotate.d/my_app_production because the file owner is wrong (should be root).

Handling 0 logs

So I fixed that, then get errors that the parent directory is also incorrect.

deploy@myhost://var/www/my_app/shared/config$ sudo chown root:root log_rotation


deploy@myhost://var/www/my_app/shared/config$ sudo logrotate -d -f /etc/logrotate.d/my_app_production
reading config file /etc/logrotate.d/my_app_production
error: /etc/logrotate.d/my_app_production:9 unknown option 'endscript' -- ignoring line

Handling 1 logs

rotating pattern: /var/www/my_app/shared/log/*.log  forced from command line (52 rotations)
empty log files are not rotated, old logs are removed
considering log /var/www/my_app/shared/log/cron.log
error: skipping "/var/www/my_app/shared/log/cron.log" because parent directory has insecure permissions (It's world writable or writable by group which is
 not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /var/www/my_app/shared/log/ember-frontend.production.log
error: skipping "/var/www/my_app/shared/log/ember-frontend.production.log" because parent directory has insecure permissions (It's world writable or writa
ble by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /var/www/my_app/shared/log/production.log
error: skipping "/var/www/my_app/shared/log/production.log" because parent directory has insecure permissions (It's world writable or writable by group wh
ich is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /var/www/my_app/shared/log/sidekiq.log
error: skipping "/var/www/my_app/shared/log/sidekiq.log" because parent directory has insecure permissions (It's world writable or writable by group which
 is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /var/www/my_app/shared/log/unicorn.log
error: skipping "/var/www/my_app/shared/log/unicorn.log" because parent directory has insecure permissions (It's world writable or writable by group which
 is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

I gave the su option a shot, and my logs are rotated now.

su deploy deploy 

Not sure what a fix should look like, either set the owner to root in setup_config or somehow set the su option globally.

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

1 participant