How to stop an amok running process from logging to systemd

logssystemd

There's a process on my system called demond which logs around 100 entries to the systemd journal every 15 seconds:

Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev0. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev1. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev2. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev3. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev4. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev5. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev6. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev7. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev8. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev9. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev10. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev11. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev12. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev13. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev14. No such file or directory
Okt 11 04:58:42 scarecrow demond[1692]: [P:1692 T:108160832] src/discovery.c : 158  getHidDevices        -- failed in opening HIDDEV file: /dev/hiddev15. No such file or directory

This fills up the journal very quickly and creates permanent disk access, which drains battery. The entries all have priority 7 (debug).

demond is part of the Lexmark printer driver. I guess they use it for Wifi discovery of devices. I contacted Lexmark support and they said they cannot change the driver, and there's no way to suppress those messages. And since the driver is closed source, I cannot change it myself.

I know that I can suppress debug level 7 altogether using MaxLevelStore=info in journald.conf, but this suppresses the debug level for all processes.

Is there a way to suppress logging for a certain process such as demond?

I'm using ArchLinux with latest systemd 208. I don't use syslog-ng or rsyslog.

Best Answer

Turned out there's an environment variable called ENABLE_D_LOG=0|1 which is 1 by default and which is responsible for the logging madness. Setting it to 0 shuts up the driver. So I created a wrapper script for demond that sets ENABLE_D_LOG=0 and then calls the original demond:

# cd /usr/local/lexmark/legacy/bin
# mv demond demond.orig
# cat > demond <<EOF
#!/bin/sh
export ENABLE_D_LOG=0
/usr/local/lexmark/legacy/bin/demond.orig $@
EOF
# chmod +x demond
Related Question