gpt4 book ai didi

linux - 在 rsyslog 配置中设置日志文件的权限

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:14:19 77 4
gpt4 key购买 nike

rsyslog 配置中有一个选项可以设置创建的日志文件的权限和所有权。

$fileOwner sv
if $programname contains 'my_process' then /var/log/my_process.log

如果日志文件 (/var/log/my_process.log) 不存在,将创建该文件,所有者为“sv”用户。 Manual

但这也会更改所有即将发布的文件的设置。

有没有办法只设置特定日志文件的权限?

最佳答案

我找到了一种可行的方法。配置完成后,将变量重置为默认值。

$fileOwner sv
if $programname contains 'my_process' then /var/log/my_process.log
$fileOwner root

关于linux - 在 rsyslog 配置中设置日志文件的权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32692714/

77 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com