Drop the dd process
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rsyslog (Ubuntu) |
Fix Released
|
Medium
|
Canonical Foundations Team | ||
Lucid |
Fix Released
|
Medium
|
Canonical Foundations Team |
Bug Description
Binary package hint: rsyslog
Until recently, the kernel required root privileges to open /proc/kmsg _and_ for reading from it. This was now fixed (see bug 515623).
To work around this, rsyslog currently installs an upstart job (/etc/init/
The dd process requires a ridiculous amount of CPU during startup, though, since it is running with bs=1 to not miss stuff:
http://
So with the fixed kernel, rsyslog can now start up as root, open /proc/kmsg, and drop the effective user to "syslog".
Some things to watch out for:
* We should keep the /etc/init/
* rsyslog should use the FIFO if it exists, and fall back to /proc/kmsg.
* rsyslog must not close/reopen the fd to /proc/kmsg if it gets a SIGHUP, since it already dropped privileges.
Related branches
Changed in rsyslog (Ubuntu): | |
assignee: | nobody → Canonical Foundations Team (canonical-foundations) |
Changed in rsyslog (Ubuntu Lucid): | |
status: | New → Triaged |
milestone: | none → ubuntu-10.04-beta-1 |
The other implementation option would be to drop the dd upstart job for good, and just let rsyslogd run as root if it detects that reading from /proc/kmsg requires root.
Test case schema:
$ sudo python '/proc/ kmsg')
[sudo] password for martin:
>>> import os
>>> f=open(
>>> os.seteuid(1000)
>>> f.read(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 1] Operation not permitted