troglobit / sysklogd

BSD syslog daemon with syslog()/syslogp() API replacement for Linux, RFC3164 + RFC5424
https://troglobit.com/sysklogd.html
Other
89 stars 20 forks source link

Setting permissions for logged files #60

Closed powerjungle closed 1 year ago

powerjungle commented 1 year ago

I couldn't find information on this anywhere. There's no mention of a way to change the permissions of the logged files and it seems impractical to do it externally. Are there plans to do it in the future or am I missing something?

I can just make /var/log not world readable, but some applications which are running as system users, can't access the directory this way.

troglobit commented 1 year ago

The sysklogd project tracks the *BSD implementations of syslogd, so no there is no such feature planned, which does not mean it's a bad idea.

What's been standard practice in UNIX systems is that the system administrator makes sure to create the log files before syslogd starts, then it just opens the files it knows about and appends the log message. However, since the sysklogd project has built-in support for log rotation, a bug was found and fixed in v2.4.0 that ensures that the new file created after rotation retains the original permissions.

I hope that answers your question. (We have a Discussions tab for this type of Q&A things, I could convert this to that if you're happy with the reply.)

powerjungle commented 1 year ago

Yeah that makes sense. Seems like a good idea to add this information to the man file as well. Thank you for the quick response!

troglobit commented 1 year ago

np, will update the man pages accordingly.