    # File lib/phusion_passenger/utils.rb, line 551
            def report_app_init_status(channel, sink = STDERR)
                    begin
                            old_global_stderr = $stderr
                            old_stderr = STDERR
                            stderr_output = ""

                            pseudo_stderr = PseudoIO.new(sink)
                            Object.send(:remove_const, 'STDERR') rescue nil
                            Object.const_set('STDERR', pseudo_stderr)
                            $stderr = pseudo_stderr

                            begin
                                    yield
                            ensure
                                    Object.send(:remove_const, 'STDERR') rescue nil
                                    Object.const_set('STDERR', old_stderr)
                                    $stderr = old_global_stderr
                                    stderr_output = pseudo_stderr.done!
                            end

                            channel.write('success')
                            return true
                    rescue StandardError, ScriptError, NoMemoryError => e
                            channel.write('exception')
                            channel.write_scalar(marshal_exception(e))
                            channel.write_scalar(stderr_output)
                            return false
                    rescue SystemExit => e
                            channel.write('exit')
                            channel.write_scalar(marshal_exception(e))
                            channel.write_scalar(stderr_output)
                            raise
                    end
            end