From: GOTOU Yuuzou Date: 2005-06-03T15:43:18+09:00 Subject: Re: WEBRick initialization In message <429FB360.3060505@verk.info>, `Alexey Verkhovsky ' wrote: > I have some WEBRick server that I would like to run as WEBRick::Daemon > (that's where a startup process forks a daemon and exits). The problem > is, there is some initialization code that must be executed _after_ the > fork (it opens a file for writing). Is there any good way to make it > happen (short of overriding WEBRick::Daemon#start method)? How about calling WEBrick::Daemon.start directly? require "webrick" WEBrick::Daemon.start httpd = WEBrick::HTTPServer.new(:Port=>10080) trap(:INT){ httpd.stop } httpd.mount_proc("/"){|req, res| res["content-type"] = "text/plain" res.body = $$.to_s } httpd.start -- gotoyuzo