Rsyslog can't write to sympa.conf log file because of missing permissions

Bug #1906918 reported by Henning Kockerbeck
10
This bug affects 2 people
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/sympa.log': open error: Permission denied [v8.2001.0 try https://www.rsyslog.com/e/2433 ]
Dec 4 23:55:51 sympa-test rsyslogd: action 'action-8-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.2001.0 try https://www.rsyslog.com/e/2007 ]
Dec 4 23:55:51 sympa-test rsyslogd: action 'action-8-builtin:omfile' resumed (module 'builtin:omfile') [v8.2001.0 try https://www.rsyslog.com/e/2359 ]
Dec 4 23:55:51 sympa-test rsyslogd: action 'action-8-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension. [v8.2001.0 try https://www.rsyslog.com/e/2007 ]
Dec 4 23:55:51 sympa-test rsyslogd: action 'action-8-builtin:omfile' resumed (module 'builtin:omfile') [v8.2001.0 try https://www.rsyslog.com/e/2359 ]

(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.d/sympa.conf. You can set the file owner before the config and reset it after. This would look similar to

-----
$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.2.40~dfsg-4.

Revision history for this message
Henning Kockerbeck (henning-kockerbeck) wrote :

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.

Revision history for this message
Robert Klaus (rkl110) wrote :

Same problem in Ubuntu 22.04

Revision history for this message
Albert Solana (asolana) wrote :

Still same problem in Ubuntu 22.04.1 LTS

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sympa (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.