LINUX.ORG.RU
решено ФорумAdmin

Dovecot LDA. Права на логи.


0

1

Добрый день.

Debian lenny. Postfix + Dovecot-lda.
По-видимому, после ротейта логов dovecot (/var/log/dovecot/*.log) новоиспечённый лог-файл имеет владельца (как мне кажется) - последнего адресата.

Т.е. хронология такова:
1) Ротейт (старый лог переименовывается в *.log.1)
2) Приходит письмо Васе и новый *.log принадлежит этому Васе (права 600).

Далее другому пользователю письмо не дойдёт: dovecot (LDA) скажет Permission denied.

/etc/logrotate.d/dovecot:

/var/log/dovecot/*.log {
        monthly
        compress
        delaycompress
        rotate 8
        missingok
        nocreate
        sharedscripts
        postrotate
                chmod 666 /var/log/dovecot/*.log
                chown -R postfix:mail /var/log/dovecot
        endscript
}

В http://wiki.dovecot.org/LDA пишут:
Normally Dovecot logs everything through its master process, which is running as root. Deliver doesn't, which means that you might need some special configuration for it to log anything at all.
Последнее мне особенно нравится.

В syslog писать не хочу. Что делать?

man logrotate сообщает

create mode owner group
Immediately after rotation (before the postrotate script is run) the log file is created (with the same name as the log file just rotated). mode specifies the mode for the log file in octal (the same as chmod(2)), owner specifies the user name who will own the log file, and group specifies the group the log file will belong to. Any of the log file attributes may be omitted, in which case those attributes for the new file will use the same values as the original log file for the omitted attributes. This option can be disabled using the nocreate option.

Эта мысль пригодится?

braindef
()

Прочел название топика. Долго думал. Засилье копирастов, меняет акценты.

FollowTheRabbit
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.