Hello all, can anyone help me figure out what permissions/ownership settings and/or configuration changes I need to make to fix logrotate.service on my Fedora 41 host?
Here is what journalctl reports: https://pastebin.com/Hp31DJEX
It seems like the permission for /var/log/samba/ and /var/log/sshd/ might be messed up? I am struggling to find what the right ownership/permissions for these directories and files should be.
Additionally, when I look in /var/log/ I see many different log files for the same services:
5 Comments
just_another_person@lemmy.world · 2 pts · 1y
Did you add/change something in the logrotate configs?
From the journal it looks like it can't create the subdirectory of
oldwhich is weird for logrotate which defaults to copy/truncate I believe to avoid permissions issues like this. If theolddirectory didn't exist before, and you've added that somewhere in the rotation configs, create the directory, and make sure whichever user that runs logrotate has full access to that directory.It's also telling you directly that it doesn't have permissions, and you need to add the "su" directive in the config to make sure it escalates for privileges.
dditty@lemm.ee · 1 pts · 1y
Thanks for the reply!
Here are the contents of
/etc/logrotate.d/sambaShould I just delete that
olddir /var/log/samba/oldline? I may have added that line when troubleshooting this issue via referencing old forum posts online, not sure.just_another_person@lemmy.world · 2 pts · 1y
Yeah, ditch that and let it just do copytruncate. Nothing else looks especially weird. You can have it move old logs somewhere else if you want, but that's largely not needed, especially if your logs are also being shuffled to journal.
dditty@lemm.ee · 1 pts · 1y
Cool so I deleted that line. I'm just hoping to get logrotate to work normally with its default configuration lol.
Here's the output of
ls -la /var/log/samba/I changed a few of these back to
root:root~ a week ago; I believe the ones forsmbdandsamba-dcerpcdwere previously owned by a user and group I set up for my samba share which I think was also causing problems. Do you know if these are otherwise correct?I just ran
sudo systemctl restart logrotate.serviceand it completed without issues. With that being said, it also completed without issues when I ran it the last couple times over the last few weeks with my old and broken config, so I'm unsure whether that single line fix from/etc/logrotate.d/sambais enough. Is there anything else you can think of I should be checking?just_another_person@lemmy.world · 2 pts · 1y
It's a permissions and pathing issue, so just check it tomorrow and see what it does.