为什么Linux上的Postfix在日志文件的路径名之前需要“ – ”字符?

为什么Linux上的Postfix在日志文件的路径名之前需要“ – ”字符?,第1张

概述我发现了以下 here: IMPORTANT: on Linux you need to put a “-” character before the pathname, e.g., -/var/log/maillog, otherwise the syslogd process will use more system resources than Postfix. 但文档没有给出任何理由.那么 我发现了以下 here:

important: on linux you need to put a “-” character before the pathname,e.g.,-/var/log/maillog,otherwise the syslogd process will use more system resources than Postfix.

但文档没有给出任何理由.那么,为什么需要这个“ – ”呢?

解决方法 只有在仍使用syslogd或较旧的rsyslog版本时才需要这样做

从http://www.rsyslog.com/doc/v3compatibility.html,“输出文件同步”部分

Rsyslogd trIEs to keep as compatible to stock
syslogd as possible. As such,it retained stock syslogd’s default of
syncing every file write if not specifIEd otherwise (by placing a dash
in front of the output file name). While this was a useful feature in
past days where harDWare was much less reliable and UPS seldom,this
no longer is useful in today’s worl. Instead,the syncing is a high
performace hit. With it,rsyslogd writes files around 50 times slower than without it. It also affects overall system performance due to the high IO activity. In rsyslog v3,syncing has been turned off by default. This is done via a specific configuration directive “$ActionfileEnableSync on/off” which is off by default. So even if rsyslogd finds sync selector lines,it ignores them by default. In order to enable file syncing,the administrator must specify “$ActionfileEnableSync on” at the top of rsyslog.conf. This ensures that syncing only happens in some installations where the administrator actually wanted that (performance-intense) feature. In the fast majority of cases (if not all),this dramatically increases rsyslogd performance without any negative effects.

总结

以上是内存溢出为你收集整理的为什么Linux上的Postfix在日志文件的路径名之前需要“ – ”字符?全部内容,希望文章能够帮你解决为什么Linux上的Postfix在日志文件的路径名之前需要“ – ”字符?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/yw/1035800.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存