'Launch a subprocess for this server.
:param conf_file: path to conf_file to use as first arg
:param once: boolean, add once argument to command
:param wait: boolean, if true capture stdout with a pipe
:param daemon: boolean, if false ask server to log to console
:returns: the pid of the spawned process'

def spawn(self, conf_file, once=False, wait=True, daemon=True, **kwargs):

    args = [self.cmd, conf_file]
    if once:
        args.append('once')
    if (not daemon):
        args.append('verbose')
    if (not daemon):
        re_out = None
        re_err = None
    else:
        re_err = subprocess.STDOUT
        if wait:
            re_out = subprocess.PIPE
        else:
            re_out = open(os.devnull, 'w+b')
    proc = subprocess.Popen(args, stdout=re_out, stderr=re_err)
    pid_file = self.get_pid_file_name(conf_file)
    write_file(pid_file, proc.pid)
    self.procs.append(proc)
    return proc.pid
