Having a problem. Almost once a day, the collectinfo.pl script leaves a zombie “php-cgi -v” call running.
Here’s an example of the process:
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 45223 100.0 0.0 71224 56176 - RJ 14:33 23:40.21 /usr/local/bin/php-cgi -v
Here’s the output of procstat:
procstat -f 45223
PID COMM FD T V FLAGS REF OFFSET PRO NAME
45223 php-cgi text v r r------- - - - /usr/local/bin/php-cgi
45223 php-cgi cwd v d r------- - - - /usr/local/lib/webmin/virtual-server
45223 php-cgi root v d r------- - - - /
45223 php-cgi jail v d r------- - - - /
45223 php-cgi 0 v c r------- 1 0 - /dev/null
45223 php-cgi 1 p - rw------ 2 0 - -
45223 php-cgi 2 p - rw------ 2 0 - -
[root@gaudete:/var/log/webmin]#
SYSTEM INFORMATION
OS type and version
FreeBSD 13.1-RELEASE-p6 on amd64
Webmin version
2.013
Virtualmin version
7.2
Perl version
5.036000
—
—
Path to Perl
/usr/local/bin/perl
Python version
3.11.2
Path to Python
/usr/local/bin/python3
BIND version
9.18
Postfix version
3.8-20230213
Mail injection command
/usr/sbin/sendmail -t
Apache version
2.4.56
PHP versions
8.2.4
Webalizer version
2.23-08
Logrotate version
3.13.0
MySQL version
8.0.32
SpamAssassin version
4.0.0
I have the full debug log from the above process, too big to paste.
It may come from one of the following lines:
procstat -f 52627
PID COMM FD T V FLAGS REF OFFSET PRO NAME
52627 php-cgi text v r r------- - - - /usr/local/bin/php-cgi
52627 php-cgi cwd v d r------- - - - /usr/local/lib/webmin/virtual-server
52627 php-cgi root v d r------- - - - /
52627 php-cgi jail v d r------- - - - /
52627 php-cgi 0 v c r------- 1 0 - /dev/null
52627 php-cgi 1 p - rw------ 2 0 - -
52627 php-cgi 2 p - rw------ 2 0 - -
Not every collectinfo run causes a zombie, it’s only one or two per day, but from the logs, timestamps and system information calls, they are clearly coming from virtualmin./webmin and collectinfo.
this happens at exactly 13, 33, or 53 minutes after an hour in all cases, the only running process in virtualmin/webmin or on any process is the collectinfo.pl - although somewhat circumstantial at first it was the first clue. After dozens of repetitions, matching only this process for exact start time, it’s more of an obvious clue.
Procstat is more appropriate here as it tells us more about a specific process. Procstat indicates conclusively that this is a virtualmin/webmin issue.
Let me know if this offers you any insight I’ve missed.
Procstat was run on one of these processes, it is in the top of this thread. I’ll re-paste it here to save you a scroll:
procstat -f 45223
PID COMM FD T V FLAGS REF OFFSET PRO NAME
45223 php-cgi text v r r------- - - - /usr/local/bin/php-cgi
45223 php-cgi cwd v d r------- - - - /usr/local/lib/webmin/virtual-server
45223 php-cgi root v d r------- - - - /
45223 php-cgi jail v d r------- - - - /
45223 php-cgi 0 v c r------- 1 0 - /dev/null
45223 php-cgi 1 p - rw------ 2 0 - -
45223 php-cgi 2 p - rw------ 2 0 - -
[root@gaudete:/var/log/webmin]#
on this box, running /usr/local/bin/php-cgi/php-cgi -v is very fast, and has no hang or consequence, even if done thousands of times by another script or process.
Good questions so far, let’s peel this back a little further.
[root@gaudete:/var/log/php-fpm]# /usr/local/bin/php-cgi/php-cgi -v
-bash: /usr/local/bin/php-cgi/php-cgi: Not a directory
[root@gaudete:/var/log/php-fpm]# stat /usr/local/bin/php-cgi/php-cgi
stat: /usr/local/bin/php-cgi/php-cgi: stat: Not a directory
I see another, related process hanging when it should go away. I suspect a conf issue inside FPM. Will reduce turnover times and tolerances to observe.
Any idea on where I can comment out the php-cgi -v for now and save a few kill lines?