l.c.s.s.ForkedProcessTransport(process.BaseProcess) : class documentation

Part of lp.codehosting.sshserver.session View In Hierarchy

Wrap the forked process in a ProcessTransport so we can talk to it.

Note that instantiating the class creates the fork and sets it up in the reactor.

Method __init__ Undocumented
Method signalProcess Send the given signal C{signalID} to the process. It'll translate a
Method write Undocumented
Method writeToChild Undocumented
Method closeChildFD Undocumented
Method closeStdin Undocumented
Method closeStdout Undocumented
Method closeStderr Undocumented
Method loseConnection Undocumented
Method childDataReceived Undocumented
Method childConnectionLost Undocumented
Method maybeCallProcessEnded Undocumented
Method _sendMessageToService Send a message to the Forking service and get the response
Method _spawn Start the new process.
Method _openHandleFailures Open the given path, adding a cleanup as appropriate.
Method _connectSpawnToReactor Undocumented
Method _getReason Undocumented
def __init__(self, reactor, executable, args, environment, proto):
Undocumented
def _sendMessageToService(self, message):
Send a message to the Forking service and get the response
def _spawn(self, executable, args, environment):
Start the new process.

This talks to the ForkingSessionService and requests a new process be started. Similar to what Process.__init__/_fork would do.

ReturnsThe pid, communication directory, and request socket.
def _openHandleFailures(self, call_on_failure, path, flags, proc_class, reactor, child_fd):
Open the given path, adding a cleanup as appropriate.
Parameterscall_on_failureA list holding (callback, args) tuples. We will append new entries for things that we open
pathThe path to open
flagsFlags to pass to os.open
proc_classThe ProcessWriter/ProcessReader class to wrap this connection.
reactorThe Twisted reactor we are connecting to.
child_fdThe child file descriptor number passed to proc_class
def _connectSpawnToReactor(self, reactor):
Undocumented
def _getReason(self, status):
Undocumented
def signalProcess(self, signalID):
Send the given signal C{signalID} to the process. It'll translate a few signals ('HUP', 'STOP', 'INT', 'KILL', 'TERM') from a string representation to its int value, otherwise it'll pass directly the value provided

@type signalID: C{str} or C{int}

def write(self, data):
Undocumented
def writeToChild(self, childFD, data):
Undocumented
def closeChildFD(self, childFD):
Undocumented
def closeStdin(self):
Undocumented
def closeStdout(self):
Undocumented
def closeStderr(self):
Undocumented
def loseConnection(self):
Undocumented
def childDataReceived(self, name, data):
Undocumented
def childConnectionLost(self, childFD, reason):
Undocumented
def maybeCallProcessEnded(self):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.