Hi,
I have a problem while running aapanel in docker using the official image.
Host system: fedora 36
Docker (docker-ce): 20.10.17
The problem is that 'lsof', which is used in aapanel scripts, use 100% of cpu and never ends. It's probably related with containerd, but I'm not sure.
I have tried using docker run with --privileged=true and --cap-add=SYS_PTRACE, but it didn't help.
Next I changed lsof calls in /usr/bin/bt and /www/server/panel/init.sh like this
old:
is_process=$(lsof -n -P -i:$port|grep LISTEN|grep -v grep|awk '{print $1}'|sort|uniq|xargs)
new
is_process=$(netstat -tnlp | grep ":$port " | grep -v grep | awk '{print $7}' | sed 's/[0-9]+\/([^:]+):\?/\1/g' | sort | uniq | xargs)
old:
is_ports=$(lsof -n -P -i:$port|grep LISTEN|grep -v grep|awk '{print $2}'|xargs)
new:
is_ports=$(netstat -tnlp | grep ":$port " | grep -v grep | awk '{print $7}' | sed 's/([0-9]+).*/\1/g' | xargs)
It makes the situation much better, but time to time aapanel calls lsof from python scripts and I am not sure how to fix it. As a stupid workaround I use cron with killall -9 lsof, if not, the server freezes after some time
Have you experienced the same problem while using aapanel inside docker container?
Do you have any idea how to fix lsof in centos7 conainer?
Thx