rsyslog fails to read kmsg on 2.6.33 kernels
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rsyslog (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: rsyslog
Kernel logging is disabled on all kernels other than the stock Ubuntu kernel, because rsyslog fails to read kmsg. Instead, it reports:
"kernel: imklog: Cannot read proc file system, 1."
This is intentional on older kernels (see bug #523610, comment 35), but it is also happening on the latest 2.6.33.2 kernel:
sudo python
>>> import os
>>> f=open(
>>> os.seteuid(1000)
>>> f.read(0)
''
>>> f.read(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 1] Operation not permitted
I don't believe it's in the spirit of things to disable logging on newer kernels (it cuts out a large number of testers for rc kernels, for instance). Why is it necessary for rsymlog to drop root privileges and disable logging if it can't access kmsg?
ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: rsyslog 4.2.0-2ubuntu8
Uname: Linux 2.6.33.2-generic x86_64
NonfreeKernelMo
Architecture: amd64
CheckboxSubmission: 1bd8e90541d49b9
CheckboxSystem: d00f84de8a55581
Date: Sat Apr 17 17:58:38 2010
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha amd64 (20100224.1)
ProcEnviron:
PATH=(custom, user)
LANG=en_AU.utf8
SHELL=/bin/bash
SourcePackage: rsyslog
summary: |
- rsyslog fails to read kmsg on newer (custom) kernels + rsyslog fails to read kmsg on 2.6.33 kernels |
Part of the problem seems to be that the patch to allow read access to kmsg to non-root users (see bug #515623, comment 1) isn't applied to 2.6.33.2. I applied the patch (it almost worked out-of-the-box, but I needed to define SYSLOG_ CONTEXT_ SYSCALL in printk.c) and this resolves the problem.
The patch appears to be included in 2.6.34-rc4, but I can't test this yet as it kernel panics on my PC at some point after X starts.
I still think rsyslog should default to the Debian behaviour (ie root access to kmsg) if 'de-rooting' doesn't work, but perhaps the quickest 'fix' for this is to include a release note saying that kernel logging is not supported with 2.6.33 kernels (or in fact any custom kernels prior to 2.6.34).