'Produce a state file for initializing the state of a client job.
Creates a new client state file with all the current server state, as
well as some pre-set client state.
:return: The path of the file the state was written into.'

def preprocess_client_state(self):

    self._state.set('client', 'sysinfo', self.sysinfo.serialize())
    (fd, file_path) = tempfile.mkstemp(dir=self.tmpdir)
    os.close(fd)
    self._state.write_to_file(file_path)
    return file_path
