Hi, I'm running freeradius 3.17. I'm using the exec module, which calls a python script. A zombie process is always left after the script terminates. That zombie process "lives" until the script is run again, no matter how long the interval is between two script runs. So no big deal, only one zombie process. But still it shouldn't be that way, so I thought I'd report it. Perhaps I'm missing something? Exec is configured like this: exec execaf { wait = no input_pairs = request shell_escape = yes timeout = 10 program = /usr/local/etc/raddb/eventfoo/eventfoo.py } It is called from the accounting {} section of the default site. The python script always calls sys.exit(0), returning success. This is the relevant htop output: 30478 freeradiu 23 0 62856 39520 S 0.0 1.0 0:02.80 ├─ /usr/local/sbin/radiusd 73486 freeradiu 73 0 0 0 Z 0.0 0.0 0:00.43 │ └─ python3.6 /usr/local/etc/raddb/eventfoo/eventfoo.py Thanks, HC
On Jan 20, 2019, at 4:59 PM, Hans-Christian Esperer <hc@hcesperer.org> wrote:
I'm running freeradius 3.17. I'm using the exec module, which calls a python script. A zombie process is always left after the script terminates. That zombie process "lives" until the script is run again, no matter how long the interval is between two script runs. So no big deal, only one zombie process. But still it shouldn't be that way, so I thought I'd report it. Perhaps I'm missing something?
The server cleans up old processes periodically, but that's based on being driven by new packets, or other timers. So if no new requests come in, it doesn't bother cleaning up zombie processes. For a host of reasons, the server doesn't catch SIGCHLD. The short one is that it's multi-threaded. And Posix (in their infinite wisdom) decreed that SIGCHLD does *not* get delivered to the thread that forked the child process. Instead, SIGCHLD gets delivered to a *random* thread. The coordination to get the signal to the right place is more work than just waiting a little bit. So this behaviour is intended, but imperfect. The fix would be some significant architectural rework. Alan DeKok.
participants (2)
-
Alan DeKok -
Hans-Christian Esperer