Frequent lsb_release Calls in Ubuntu 18.04

topubuntu-18.04

I have an odroid XU4 running the manufacturer-provided minimal Ubuntu 18.04. Every few seconds (it's not really consistent, but think between 5 and 30) I get a call to lsb_release. Sometimes it gets called with the -r flag, others with -i. This causes a spike in CPU usage that turns on the board's fan (which is quite annoying).

I saw this question, but disabling auto-updates in /etc/apt/apt.conf.d/20unattended-upgrades did not reduce the number of calls. Since this is a python script, I tried to track the caller using the methods described in this question. However, the one with os.getppid does not work if the caller is not another python script (at least in my testing), and the second one with psutil does not work because import psutil fails when done within lsb_release for some reason.

Did anyone encounter this and know where all this calls come from? Or perhaps someone has other ideas to track who is calling lsb_release? Thanks!

Edit: average over 40 minutes is 1 call every 7 seconds. 51.1% of the calls have -r, the rest have -i

Best Answer

You could temporarily move /usr/bin/lsb-release to /usr/bin/orig-lsb-release and put a script in its place containing something along the lines of

#!/bin/sh
ps axf > /tmp/inflagranti.txt
exec /usr/bin/orig-lsb-release "$@"

Then when the file /tmp/inflagranti.txt has been created you can move /usr/bin/orig-lsb-release back to /usr/bin/lsb-release and peruse /tmp/inflagranti.txt at leisure to find who called your script.

Related Topic