On examining the code it looks as if these external processes require
something to be configured which is not configured. So it appears that
every one of these zombies is failing to even do anything.
In that case, it sounds like you could just comment out the code that’s
trying to call the external processes, and you would immediately eliminate
the zombies without losing any functionality that you have at the
moment. I’d probably start there.
In fact, that’s what I did. The code didn’t do anything, so I deleted
Next figure out whether you really need those external processes to
run. If not then you’re done; maybe the reason to run them has gone away
since this was first set up. If you do need them, then configure them so
they run properly in ‘standalone’ mode, then uncomment the original code and
chances are you won’t have the same zombie problem anymore.
The external processes actually called the app itself, via curl.
The external processes are now considered evil in my book. Anything
which spawns zombies is evil; anything which calls itself recursively
via HTTP is also evil. Therefore, evil.
(Actually, one day we’ll probably have apps that call themselves via
HTTP, and it’ll be higher-order HTTP, and that’ll be great, but for
As for exec() vs. system(), the biggest difference is whether you want any
code after that call to get executed. Since exec replaces the current
process with the new one, any code after the exec() call will never get run.
If it’s the last line of the program anyway, then this won’t matter to you.
Well, it wasn’t the last line of code, but it wasn’t really being
called properly. Ordinarily I use system() rather than exec(), on the
assumption that in most cases I want the program to continue its end.