def process_spawn_ruby_1_8(detached)
      rd, wr = IO.pipe

      if Process.fork      #parent
        wr.close
        pid = rd.read.to_i
        rd.close
        return pid
      else                 #child
        rd.close

        detach if detached #daemonization

        wr.write(Process.pid)
        wr.close

        STDIN.reopen "/dev/null"
        STDOUT.reopen "/dev/null", "a"
        STDERR.reopen "/dev/null", "a"

        Kernel.exec "#{headless? ? 'cvlc' : 'vlc'} --extraintf rc --rc-host #{@host}:#{@port}"
      end
    end
def process_spawn_ruby_1_8(detached)
      rd, wr = IO.pipe

      if Process.fork      #parent
        wr.close
        pid = rd.read.to_i
        rd.close
        return pid
      else                 #child
        rd.close

        detach if detached #daemonization

        wr.write(Process.pid)
        wr.close

        STDIN.reopen "/dev/null"
        STDOUT.reopen "/dev/null", "a"
        STDERR.reopen "/dev/null", "a"

        Kernel.exec "#{headless? ? 'cvlc' : 'vlc'} --extraintf rc --rc-host #{@host}:#{@port}"
      end
    end
For ruby 1.8