Conversation:
Notices
-
@takeshitakenji I guess you just want to remove them from the array of PIDs, or do you need to do other cleanup tasks?
-
@takeshitakenji You could also do the cleanup when you detect the process is dead if you need to.
As to how to do so it depends on how certain you need to be that it is in fact dead. (And not hung etc)
The easiest way is something like exec("ps -A|grep {$pid}"); but exec is disabled in a lot of setups for security reasons. The proper way depends on how you're spawning the process.
-
@takeshitakenji Thought: you could check for the existence of /proc/{$pid}
-
@takeshitakenji You will definitely want the sleep in there, but I think it should be okay to do that as long as you have that.
-
@takeshitakenji The GS train has no brakes.
-
@purplehippo @takeshitakenji Well, Takeshi is working on multiple processes, so, thats kind of similar