🕷 zenspider.com

by ryan davis

Looking for the Ruby Quickref?

Vlad Hanging on you?

Published 2007-10-17 @ 16:53

Tagged rubyhitsquad, rails, ruby

I just finished writing up a lighttpd plugin for Vlad so I can switch my textdrive projects over. I had a problem where firing up lighttpd would hang. I knew there wasn’t any IO it was actually waiting on, it was just hanging…

After googling I found a similar bug regarding capistrano having the same problem and the workaround offered works beautifully!

The solution/workaround is to forcibly detach all IO from the process:

  #{web_command} -f #{lighttpd_conf} </dev/null >/dev/null 2>&1

For non-unix geeks, this:

  • merges stdout and stderr (2>&1)
  • redirects stdout to /dev/null
  • redirects/attaches /dev/null to stdin

By doing this, ssh doesn’t hang around waiting for more stuff to happen. This is specific to lighttpd, but I’m guessing there are other daemons out there with similar problems.