meuter / argon-one-case-ubuntu-20.04

port of the argon one case power button and fan script for Ubuntu 20.04 on rpi 4
255 stars 49 forks source link

zombie process is detected #4

Closed estshorter closed 3 years ago

estshorter commented 3 years ago

After installing this script, "There is 1 zombie process" is shown in the welcome message(motd).

After debugging, I found that the cause was the following line. https://github.com/meuter/argon-one-case-ubuntu-20.04/blob/25b872eec950d2e6b519b5ec114a94e1a757787c/argon1.sh#L252

I think just using open() is enough like this:

echo '      with open("/sys/class/thermal/thermal_zone0/temp", "r") as fp:' >> $powerbuttonscript
echo '          temp = fp.readline()' >> $powerbuttonscript

Environment

estshorter commented 3 years ago

@meuter ping!

meuter commented 3 years ago

Thanks for the report @estshorter. What you're proposing seems more than reasonable indeed. I'm not sure why I used popen("cat ...").readline(). It's a bit convoluted, tbh. I'll run some tests over the weekend; and merge the PR.

joelw135 commented 3 years ago

Would you be able to correct the desktop icons thing so it uses Mate-terminal?