in reply to Fast CGI termination

How does a Fast CGI program know that Apache is terminating it?

That question makes no sense. Apache doesn't terminate the FCGI daemon.

It is how to run the cleanup part that I cannot figure out?

In theory, you should never reach that code. `CGI::Fast->new` will only fail if there's a bug in the library or for OS errors such as accept failing.