Log file owner changing to root -- causing access errors
Added by Lucas Layman about 10 years ago
Hello, and I apologize for the newb question, but I am at a loss.
I have my Redmine instance running under Apache2 w/ Passenger. Periodically, my log/production.log.0 and one other log/production.log.X file will change owner from www-data to root. This causes an access error and Redmine displays an exception. The simple fix is to chown www-data:www-data log/*
, until it happens again.
I imagine this is a novice configuration error, but I can't find any help on the matter. Any thoughts would be appreciated.
My config/additional_environment.rb:
# Copy this file to additional_environment.rb and add any statements # that need to be passed to the Rails::Initializer. `config` is # available in this context. # # Example: # # config.log_level = :debug # ... # config.logger = Logger.new('/usr/share/redmine/log/production.log', 5, 1000000) config.logger.level = Logger::INFO
My script/about:
Environment: Redmine version 2.0.3.stable Ruby version 1.9.3 (x86_64-linux) Rails version 3.2.6 Environment production Database adapter Mysql2 Redmine plugins: redmine_backlogs v0.9.26 redmine_monitoring_controlling 0.1.1 redmine_work_time 0.2.4 wiking 0.0.2
Thanks again.
Replies (3)
RE: Log file owner changing to root -- causing access errors
-
Added by Martin Denizet (redmine.org team member) about 10 years ago
Hi Lucas,
You seem to be using the Debian/Ubuntu Redmine package. I suggest that you problem is linked to logrotate.
Have a look in /etc/logrotate.d/
If you find a rotation file for redmine. Open it a check that the create
statement gives the correct permissions to the user running Redmine (www-data?)
Cheers,
RE: Log file owner changing to root -- causing access errors
-
Added by Lucas Layman about 10 years ago
Hi Martin,
Thank you for the reply. Unfortunately /etc/logrotate.d/
has no configuration related to redmine. There is one for apache2, but I don't know if that is applicable:
/var/log/apache2/*.log { weekly missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null endscript prerotate if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ run-parts /etc/logrotate.d/httpd-prerotate; \ fi; \ endscript }
Thanks again for your time.
Lucas
RE: Log file owner changing to root -- causing access errors
-
Added by popy popy 3 months ago
I found out that we have setup fetching changesets in cron with root user (sudo crontab -e).
Changing that job to the normal user solved the issue (crontab -e).