我正在使用默认的 rsyslog 和 logrotate 实用程序在 Ubuntu 14 上工作。
在默认的 rsyslog logrotate/etc/logrotate.d/rsyslog
配置中,我看到以下内容:
/var/log/syslog
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
}
Run Code Online (Sandbox Code Playgroud)
据我了解,建议在所有 logrotate 场景中使用 copytruncate,因为它不会移动当前日志,而是截断日志,因此任何具有打开文件处理程序的进程都能够继续写入它。
那么默认配置如何使用 rsyslog 重新加载功能呢?