LWN.net Logo

log why the permission is denied

log why the permission is denied

Posted Jan 21, 2013 8:40 UTC (Mon) by jorgegv (subscriber, #60484)
In reply to: log why the permission is denied by dlang
Parent article: Making EPERM friendlier

If you strace the simplest command, say 'ls -l', you'll find hundreds of system calls which return an error and are ignored by the 'ls' process. E.g.: trying to open the dozen or so possible locations of locale files, ld.so files, etc.

If all of those error-returning calls each get a line or two sent to syslog with the reasons for the denial, you'll fill your log partition pretty quickly. Appart from the huge workload the syslog process would have.

The policy ('I want this error logged' or 'I don't want this error logged') belongs in userspace, not kernel.


(Log in to post comments)

log why the permission is denied

Posted Jan 21, 2013 9:07 UTC (Mon) by dlang (✭ supporter ✭, #313) [Link]

syslog is userspace, and it can handle large volumes of logs and filter them efficently ;-)

that said, if the logs are not written sanely, filtering them can be expensive, but given that we are talking about adding the logging now, we should be able to make this be something easy to filter.

log why the permission is denied

Posted Jan 21, 2013 10:16 UTC (Mon) by meuh (subscriber, #22042) [Link]

Why not introduce a non-POSIX, Linux specific way to turn on error logging for "critical" code path, the same way one can enable logging in Bourne shell: set -x, then disable after the "critical" code path: set +x.

Sadly, I'm not really convinced myself: even if there's only one POSIX function in the "critical" section, this call could be translated in multiple library function and syscall calls. And this is going to create some annoyance when reading logs.

log why the permission is denied

Posted Jan 21, 2013 10:26 UTC (Mon) by meuh (subscriber, #22042) [Link]

And let's be funnier: add SIG_ERRNO, a signal triggered when a syscall return a an error code, and extend siginfo_t to hold error description.
Then have the kernel export, as part of the VDSO, an error decoder library.
But to be expandable, a user space library might be better.

log why the permission is denied

Posted Jan 21, 2013 23:19 UTC (Mon) by cmccabe (guest, #60281) [Link]

Not enterprisey enough.

We need ErrnoKit, a DBUS-enabled daemon that sends XML messages to a Mono process, which logs them in a custom binary format to the GNOME3 registry. Then they can be retrieved by the client application through SOAP requests to a CORBA object broker.

log why the permission is denied

Posted Jan 22, 2013 9:17 UTC (Tue) by niner (subscriber, #26151) [Link]

You're missing the most important piece: the error messages need to get stored in the Cloud! There the localization can be crowd sourced and error message profiles be monetized. I think, we should put this project up on kickstarter immediately...

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds