Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Hello all I am using rsyslog on Ubuntu 10.4 64bit LTS.

the following is the relevant config in /etc/rsyslog.d/60-mylogger.conf

$template Paul,"%msg%\n"

$outchannel log_rotation_paul,/var/log/paul/events.log,2000,/opt/scripts/log_rotation_script.sh

local0.* $log_rotation_paul;Paul

This should rotate every 2000 bytes

My problem is the the channel directive here causes the ownership defined in /etc/rsyslog.conf to be completely ignored and when my log rotate script is called I don't have the root permissions required to move my log file as its the script runs as rsyslog and the file I am moving requires root permissions.

Any ideas I found this link but unfortunately it does not fix my issue.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

If I understand correctly, /var/log/paul/events.log is owned by root; yet, you have a script running as the rsyslog user, who cannot move /var/log/paul/events.log.

sudo chown -R root.rsyslog /var/log/paul/
sudo chmod 0775 /var/log/paul
sudo chmod g+s /var/log/paul

Now, new files in /var/log/paul are always owned by rsyslog. Another solution to use is ACL.

share|improve this answer
    
Thanks Christopher –  Paul Whelan Feb 3 '11 at 9:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.