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

Configuration of logrotate in Raspberry image incorrect #944

Open
tammtimmer opened this issue Aug 14, 2023 · 2 comments
Open

Configuration of logrotate in Raspberry image incorrect #944

tammtimmer opened this issue Aug 14, 2023 · 2 comments

Comments

@tammtimmer
Copy link

The configuration file /etc/logrotate.d/vzlogger isn't correct.

The first line should be /var/log/vzlogger/*log {

Further the group write permissions for the directory /var/log/vzlogger/ should be removed.

After that the log rotation should work.

@J-A-U
Copy link
Collaborator

J-A-U commented Aug 14, 2023

The first line should be /var/log/vzlogger/*log {
You're right, missed that when the directory got changed.

Further the group write permissions for the directory /var/log/vzlogger/ should be removed.
No can do. The different permission is necessary to run vzlogger with changed user-privileges, it's safer when vzlogger is running scripts and binaries as meter 'exec'.
Do you have an alternative solution in mind?

PR as resolution for this matter is welcome.

@tammtimmer
Copy link
Author

I try something and I think the vzlogger script should be

/var/log/vzlogger/*log {
        rotate 4
        size=100k
        copytruncate
        missingok
        notifempty
        su root root
        create 0664 vzlogger vzlogger
}

Important is su line before creating the new file. I try it with the command

sudo logrotate -f /etc/logrotate.d/vzlogger

It works fine, but I don't have experience with real cron job.

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