Log file permissions being changed

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Log file permissions being changed

Post by baz123 »

I am running EmonCMS locally on DietPi and am finding the log file permissions keep getting changed. I am using the standard setup for DietPi logs (so rotate each hour) and I wonder if as part of that process the permissions are being changed?

Just trying to confirm this is the likely cause of this oddity.

Does logrotate write to a log file?
User avatar
MichaIng
Site Admin
Posts: 2259
Joined: Sat Nov 18, 2017 6:21 pm

Re: Log file permissions being changed

Post by MichaIng »

Jep logrotate writers to the files/rotate old and create new with new user and permissions in case.
You can adjust which user and permissions are used within /etc/logrotate.d/<modulr>.
I found that as an issue by times as well, e.g. in combination with mysql, apache or redis logs.

By default DietPi uses no logrotate but non-persistent RAMlog. But I guess you switched to persistent rsyslog+logrotate handling, then DietPi does not interfer.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Log file permissions being changed

Post by Fourdee »

Hi,

Only change DietPi-RAMlog makes (required for our EmonCMS installation in dietpi-software):
https://github.com/Fourdee/DietPi/blob/ ... og#L52-L53

Although, this will not effect the user:group permission on file. Permissions set, are kept by DietPi-RAMlog and logclear.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply