Prevent mraa-gpio from journald logging

Hi
I created a small systemd service which frequently uses mraa-gpio to poll a pin.
Although I configured StdOut/Err to be null in the systemd unit definition, mraa-gpio “spams” journald with status messages:

Oct 12 16:28:40 radxa-zero libmraa[20514]: libmraa initialised for platform ‘Radxa Zero’ of type 30
Oct 12 16:28:41 radxa-zero libmraa[20536]: libmraa version v2.1.0-22-gb34cd50 initialised by user ‘root’ with EUID 0
Oct 12 16:28:41 radxa-zero libmraa[20536]: gpio: platform doesn’t support chardev, falling back to sysfs
Oct 12 16:28:41 radxa-zero libmraa[20536]: libmraa initialised for platform ‘Radxa Zero’ of type 30
Oct 12 16:28:41 radxa-zero libmraa[20538]: libmraa version v2.1.0-22-gb34cd50 initialised by user ‘root’ with EUID 0
Oct 12 16:28:41 radxa-zero libmraa[20538]: gpio: platform doesn’t support chardev, falling back to sysfs
Oct 12 16:28:41 radxa-zero libmraa[20538]: libmraa initialised for platform ‘Radxa Zero’ of type 30
Oct 12 16:28:42 radxa-zero libmraa[20540]: libmraa version v2.1.0-22-gb34cd50 initialised by user ‘root’ with EUID 0
Oct 12 16:28:42 radxa-zero libmraa[20540]: gpio: platform doesn’t support chardev, falling back to sysfs
Oct 12 16:28:42 radxa-zero libmraa[20540]: libmraa initialised for platform ‘Radxa Zero’ of type 30
Oct 12 16:28:42 radxa-zero libmraa[20542]: libmraa version v2.1.0-22-gb34cd50 initialised by user ‘root’ with EUID 0

What I assume/understand? here, is that libmraa/mraa-gpio uses syslog for these messages, and these are recorded/captured by systemd-journald.

I found a journald config for “ForwardToSyslog” and “MaxLevelSyslog”, but these settings work in the other direction.What can I do to stop mraa-gpio talking to journald - instead of recompiling it? (to which i am not skilled enough).

According to https://www.ctrl.blog/entry/systemd-log-levels.html, it seems you can simply set LogLevelMax=0 in your service file in order to silence it.

Thank you for that cool tip!
[Service] LogLevelMax=0 in the systemd unit config
quiescent those chatty mraa messages. My logfiles encountered a big relief!

1 Like

Cool, cool. I actually learned something about systemd yesterday, too. Obviously I don’t know anything, being a confirmed openrc user. Service file, unit, potayto, potahto :stuck_out_tongue: