Summary: | logrotate.service не отправляет сообщения на почту, если установлен пакет mailx | ||
---|---|---|---|
Product: | Sisyphus | Reporter: | Alexander Makeenkov <amakeenk> |
Component: | logrotate | Assignee: | Alexey Shabalin <shaba> |
Status: | NEW --- | QA Contact: | qa-sisyphus |
Severity: | normal | ||
Priority: | P5 | CC: | andy, ldv, legion |
Version: | unstable | ||
Hardware: | x86_64 | ||
OS: | Linux |
Description
Alexander Makeenkov
2023-06-01 09:17:28 MSK
Странно, у меня всегда работало именно с mailx. # rpm -q mailx
mailx-8.1.2-alt9.x86_64
# cat /etc/logrotate.d/test
/var/log/test {
rotate 3
size 1K
compress
delaycompress
create 0644 root root
postrotate
touch /var/log/logrotate-done-$(date +%s)
endscript
mail andy
mailfirst
}
# cat /etc/systemd/system/logrotate.service.d/override.conf
[Unit]
Description=Rotate log files
Documentation=man:logrotate(8) man:logrotate.conf(5)
RequiresMountsFor=/var/log
ConditionACPower=true
[Service]
Type=oneshot
ExecStart=/usr/sbin/logrotate /etc/logrotate.d/test
Nice=19
IOSchedulingClass=best-effort
IOSchedulingPriority=7
LockPersonality=true
# l /var/log/test*
-rw-r--r-- 1 root root 1313 июн 1 23:32 /var/log/test
# systemctl start logrotate.service
# suspend
Для вас есть почта в /var/mail/andy
andy@andy:~$ mail
Mail version 8.1.2 01/15/2001. Type ? for help.
"/var/mail/andy": 1 message 1 new
>N 1 root@andy.basealt Thu Jun 1 23:33 26/1768 /var/log/test.1
"Всё работает" (c)
|