System Monitors

Hello,
I have looked into code of
/usr/libexec/webmin/fastrpc.cgi

here the problem cycle:
350 while(1) {
351 $$port++;
352 $pack = pack_sockaddr_in($$port, INADDR_ANY);
353 next if (!bind($fh, $pack));

358 last;
359 }

The variable $$port grow without limits if script can not bind socket by some reasons. Script write a line to the log each iteration.
Loop check must be there. For example force script termination if socket was not bind after trying port 65535.

@Jamie, this is your code – what do you think about it?

Related:

I think the real question here is why all those ports are unavailable for binding?

Yeah that’s the offending code, and my fix will at least cause it to bail out more cleanly if no ports are available. But it should never happen that all 65535 ports are in use unless something else crazy is happening. I’d be interested to see what lsof -i tcp reports in that case.

@UJig Any update on this?