|
|
@ -790,11 +790,11 @@ class Stream(mitogen.core.Stream):
|
|
|
|
sys.executable += sys.version[:3]
|
|
|
|
sys.executable += sys.version[:3]
|
|
|
|
os.environ['ARGV0']=sys.executable
|
|
|
|
os.environ['ARGV0']=sys.executable
|
|
|
|
os.execl(sys.executable,sys.executable+'(mitogen:CONTEXT_NAME)')
|
|
|
|
os.execl(sys.executable,sys.executable+'(mitogen:CONTEXT_NAME)')
|
|
|
|
os.write(1,'EC0\n')
|
|
|
|
os.write(1,'MITO000\n')
|
|
|
|
C=_(os.fdopen(0,'rb').read(PREAMBLE_COMPRESSED_LEN),'zip')
|
|
|
|
C=_(os.fdopen(0,'rb').read(PREAMBLE_COMPRESSED_LEN),'zip')
|
|
|
|
os.fdopen(W,'w',0).write(C)
|
|
|
|
os.fdopen(W,'w',0).write(C)
|
|
|
|
os.fdopen(w,'w',0).write('PREAMBLE_LEN\n'+C)
|
|
|
|
os.fdopen(w,'w',0).write('PREAMBLE_LEN\n'+C)
|
|
|
|
os.write(1,'EC1\n')
|
|
|
|
os.write(1,'MITO001\n')
|
|
|
|
|
|
|
|
|
|
|
|
def get_boot_command(self):
|
|
|
|
def get_boot_command(self):
|
|
|
|
source = inspect.getsource(self._first_stage)
|
|
|
|
source = inspect.getsource(self._first_stage)
|
|
|
@ -870,13 +870,17 @@ class Stream(mitogen.core.Stream):
|
|
|
|
self._reap_child()
|
|
|
|
self._reap_child()
|
|
|
|
raise
|
|
|
|
raise
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#: For ssh.py, this must be at least max(len('password'), len('debug1:'))
|
|
|
|
|
|
|
|
EC0_MARKER = 'MITO000\n'
|
|
|
|
|
|
|
|
EC1_MARKER = 'MITO001\n'
|
|
|
|
|
|
|
|
|
|
|
|
def _ec0_received(self):
|
|
|
|
def _ec0_received(self):
|
|
|
|
LOG.debug('%r._ec0_received()', self)
|
|
|
|
LOG.debug('%r._ec0_received()', self)
|
|
|
|
write_all(self.transmit_side.fd, self.get_preamble())
|
|
|
|
write_all(self.transmit_side.fd, self.get_preamble())
|
|
|
|
discard_until(self.receive_side.fd, 'EC1\n', self.connect_deadline)
|
|
|
|
discard_until(self.receive_side.fd, 'MITO001\n', self.connect_deadline)
|
|
|
|
|
|
|
|
|
|
|
|
def _connect_bootstrap(self, extra_fd):
|
|
|
|
def _connect_bootstrap(self, extra_fd):
|
|
|
|
discard_until(self.receive_side.fd, 'EC0\n', self.connect_deadline)
|
|
|
|
discard_until(self.receive_side.fd, 'MITO000\n', self.connect_deadline)
|
|
|
|
self._ec0_received()
|
|
|
|
self._ec0_received()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|