Score:0

lsb_release called every few seconds

pk flag

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

Score:0
bd flag

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.

manugutito avatar
pk flag
This would not work because lsb_release is run as `python3 /path/to/script`, but you inspired me to use the `subprocess` module to run `ps axf`. Sure enough, the calls with the `-i` flag seem to come from `cloudshell-lcd`, which is a small program to control an LCD screen. I will have a look there to see why this is being called so much, and then have another look to find the `-r` caller. Thanks a lot!
manugutito avatar
pk flag
It seems I can't upvote, but I marked your answer as accepted. Cheers!
manugutito avatar
pk flag
For future reference, the calls with `-r` are also due to `cloudshell-lcd`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.