rsyslogd: file '/dev/console': open error: Permission denied
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rsyslog (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Eric Desrochers |
Bug Description
[Impact]
At the moment rsyslog cannot have access /dev/console due to a mismatch permission/
[Test Case]
* Deploy focal/20.04LTS (tested in gcloud instance)
* Install rsyslog
* systemctl restart rsyslog OR systemctl restart rsyslog
* Inspect /var/log/syslog for the following error:
syslog:Aug 4 14:37:56 <HOSTNAME> rsyslogd: file '/dev/console': open error: Permission denied [v8.2001.0 try https:/
[Regression potential]
https:/
[Other information]
Other bug:
https:/
[Original description]
The Privilege Drop options ($PrivDrop*) in focal's rsyslog both point to 'syslog' for the user and group, and don't match the ownership/
syslog:Aug 3 15:16:58 <HOSTNAME> rsyslogd: file '/dev/console': open error: Permission denied [v8.2001.0 try https:/
Looking in Bionic/18.04LTS, '/dev/console' used to be root:syslog[1], nowadays it's root:tty[2]
[1] - Bionic/18.04LTS (Gcloud instance)
# ls -l /dev/console
crw--w---- 1 root syslog 5, 1 Aug 3 15:17 /dev/console
[2] - Focal/20.04LTS (Gcloud instance)
# ls -l /dev/console
crw--w---- 1 root tty 5, 1 Aug 3 17:19 /dev/console
# /etc/rsyslog.conf
$PrivDropToUser syslog
$PrivDropToGroup syslog
** As a debug exercise I did the following:
- Cannot reproduce the situation if I intentionally get rid of the PrivDrop* options.
- Cannot reproduce the situation if I intentionally add 'syslog' user member of 'tty' group.
Meaning that it's pretty obvious with the above statement that the permission denied is caused by the permission/
Other bug:
https:/
tags: | added: seg sts |
description: | updated |
Changed in rsyslog (Ubuntu Focal): | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Eric Desrochers (slashd) |
description: | updated |
description: | updated |
description: | updated |
tags: |
added: verification-done verification-done-focal removed: verification-needed verification-needed-focal |
One easy fix would possibly be the following:
# debian/ rsyslog. postinst
case "$1" in
configure)
adduser --system --group --no-create-home --quiet syslog || true
adduser syslog adm || true
+adduser syslog tty || true
I have tested it in a PPA, and it works just fine:
Preparing to unpack .../rsyslog_ 8.2001. 0-1ubuntu1+ test2020307b1_ amd64.deb ... 0-1ubuntu1+ test2020307b1) over (8.2001.0-1ubuntu1) ... 0-1ubuntu1+ test2020307b1) ... d/disable: usr.sbin.rsyslogd
Unpacking rsyslog (8.2001.
Setting up rsyslog (8.2001.
The user `syslog' is already a member of `adm'.
Adding user `syslog' to group `tty' ...
==> Adding user syslog to group tty <==
Done.
Skipping profile in /etc/apparmor.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.1) ...
# /etc/group
tty:x:5:syslog