[Rpm-maint] [PATCH] add syslog support to rpm (when installing/removing packages)
pmatilai at redhat.com
Thu Nov 22 08:19:12 UTC 2012
On 11/22/2012 05:42 AM, Thierry Vignaud wrote:
You had a typo in the mailing list address: 'pm-main at lists.rpm.org' but
apparently some catchall-alias sent it to me afterall. Since rpm-maint
was obviously the intent, replying to the list.
> The following patch adds syslog support to rpm
> (logging installing/removing packages).
> It was proposed a year ago and Panu asked a little cleaning:
> Here's the cleaned version.
> I've also added some historic notes.
> Commenting out %_transaction_syslog_ident disables it.
> Please apply to master as well as to rpm-4.11 branch
Sorry for not commenting on the (privately sent) patch earlier, just
been busy with other stuff.
For a long time I had no idea whether you were going to do anything
about the syslog patch so I went ahead and played around with it a bit
on my own. A major issue nobody noticed or at least commented on in the
previous round is that this ends up logging way too much:
Test transactions are getting logged, this is not good: if I as a
regular user run 'rpm -e --test --nodeps --allmatches glibc', that
really must NOT be logged, but that's what happens currently:
Nov 22 09:36:53 localhost lt-rpm: [RPM] erase glibc-2.14.90-24.fc16.9.i686
Nov 22 09:36:53 localhost lt-rpm: [RPM] erase glibc-2.14.90-24.fc16.9.x86_64
Largely similar to 1), operations on chroots and non-system database get
logged identically to everything else. For example just executing the
rpm test-suite as a regular user emits tons of stuff in the syslog - not
Whether chroot operations should be logged at all I dunno: there are
situations where you might want it (such as during initial system
install) and then there are those where you probably dont want it. At
the very least the chroot needs to be logged as well. Another quirk is
the rpmdb path: if you do a --justdb install/erase of packages on an
alternative db path, that shouldn't be logged. But then... what if
somebody does something like:
# cp -avp /var/lib/rpm /tmp/junkdb
# rpm -Uvh --dbpath /tmp/junkdb nastypackage.rpm
(or erase something)
That would modify the actual system but leave the system rpmdb unaware
of those changes, and should be logged, along with the rpmdb path that
And while adding logs, there are a bunch of other things we arguably
should log as well. At least:
- Transaction start and stop, along with the transaction id. That makes
it easyish to see things like "here's a transaction that started but
didn't finish, so rpm has crashed or gotten killed while installing".
- Package scriptlet failures
- Rebuilds of the system rpmdb
- Bunch of other information about the transactions:
- select parts of active configuration (eg the rpmdb path)
- select transaction flags, such as whether scriptlet execution was
disabled, disk-space calculations ignored, file replacement forced etc
- other things that seem like flags but are not in the librpm API,
such as the effect of --nodeps and --noorder
I've a work-in-progress patch to do some of the things here, but its
nowhere near complete. And with all the plugin-discussions going around,
I've started thinking of pushing the whole logging thing into a plugin.
So there would be a "reference rpm logging plugin" that does roughly the
above shipped with rpm, distros get to choose whether to use that or
something more specialized.
- Panu -
More information about the Rpm-maint