Rsyslog can't write to sympa.conf log file because of missing permissions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sympa (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Sympa is sending its log messages to rsyslogd, which is supposed to write them to /var/log/sympa.log. But this file is owned by sympa:sympa, so rsyslogd can't write to it. If it tries, you get errors like
-----
Dec 4 23:55:51 sympa-test rsyslogd: file '/var/log/
Dec 4 23:55:51 sympa-test rsyslogd: action 'action-
Dec 4 23:55:51 sympa-test rsyslogd: action 'action-
Dec 4 23:55:51 sympa-test rsyslogd: action 'action-
Dec 4 23:55:51 sympa-test rsyslogd: action 'action-
(suspend-resumed repeated multiple times)
-----
in /var/log/syslog. Sympa's log messages go to syslog, too.
This could possibly solved in two ways. One is to hand sympa.log over to a fitting owner and group like syslog:adm. But I don't know whether or in what way Sympa itself needs access to sympa.log, so this might not be the best solution.
The second way is to extend the rsyslogd conf for Sympa in /etc/rsyslog.
-----
$fileOwner sympa
:programname, contains, "sympa" /var/log/sympa.log
:programname, contains, "wwsympa" /var/log/sympa.log
:programname, contains, "archived" /var/log/sympa.log
:programname, contains, "bounced" /var/log/sympa.log
:programname, contains, "bulk" /var/log/sympa.log
:programname, contains, "task_manager" /var/log/sympa.log
$fileOwner root
-----
This problem appears in Ubuntu 20.04.1 with the package version sympa_6.
As it turned out after further investigation, changing the log file's group from sympa to adm, plus changing the mode to 640, seems to be sufficient to give rsyslog access. As the config fragment for logrotate uses the same attributes to create new logfiles, I'd say this is the best solution.