[Mongrel] Errno::EBADF (Bad file descriptor)

Jan Svitok jan.svitok at gmail.com
Mon Nov 6 14:44:52 EST 2006


On 11/6/06, Justin Johnson <justinjohnson at gmail.com> wrote:
> Does anyone have any advice on how to resolve the problem reported at
> http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145

You are running a service that does not have STDIN, STDOUT nor STDERR,
therefore you cannot write to them. If you want to debug, I suggest
opening a file (local file, service doesn't 'see' substs or network
drives) and writing to that. Maybe Logger or Log4r would be useful.

Another possibility is to use OutputDebugString and DbgView[1], but
I'm not sure if service is allowed to call it.

require 'Win32API'

module Windows
   module Debug
      OutputDebugString              = Win32API.new('kernel32',
'OutputDebugStringA', 'P', 'V')
      def OutputDebugString(message)
         OutputDebugString.call(message)
      end
   end
end

[1] http://www.sysinternals.com/Utilities/DebugView.html


More information about the Mongrel-users mailing list