def startup(self):
        ''' Start a new namespace node by invoking the vnoded process that
            allocates a new namespace. Bring up the loopback device and set
            the hostname.
        '''
        if self.up:
            raise Exception, "already up"
        vnoded = ["%s/vnoded" % CORE_SBIN_DIR, "-v", "-c", self.ctrlchnlname,
                  "-l", self.ctrlchnlname + ".log",
                  "-p", self.ctrlchnlname + ".pid"]
        if self.nodedir:
            vnoded += ["-C", self.nodedir]
        env = self.session.getenviron(state=False)
        env['NODE_NUMBER'] = str(self.objid)
        env['NODE_NAME'] = str(self.name)

        try:
            tmp = subprocess.Popen(vnoded, stdout = subprocess.PIPE, env = env)
        except __HOLE__, e:
            msg = "error running vnoded command: %s (%s)" % (vnoded, e)
            self.exception(coreapi.CORE_EXCP_LEVEL_FATAL,
                "SimpleLxcNode.startup()", msg)
            raise Exception, msg
        try:
            self.pid = int(tmp.stdout.read())
            tmp.stdout.close()
        except Exception:
            msg = "vnoded failed to create a namespace; "
            msg += "check kernel support and user priveleges"
            self.exception(coreapi.CORE_EXCP_LEVEL_FATAL,
                           "SimpleLxcNode.startup()", msg)
        if tmp.wait():
            raise Exception, ("command failed: %s" % vnoded)
        self.vnodeclient = vnodeclient.VnodeClient(self.name,
                                                   self.ctrlchnlname)
        self.info("bringing up loopback interface")
        self.cmd([IP_BIN, "link", "set", "lo", "up"])
        self.info("setting hostname: %s" % self.name)
        self.cmd(["hostname", self.name])
        self.up = True
dataset/ETHPy150Open coreemu/core/daemon/core/netns/vnode.py/SimpleLxcNode.startup