rad  3.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Public Attributes | List of all members
etr.tools.subprocess.KillOrphansContextManager Class Reference

Use instead of popen to perform cleanup of orphan subprocesses. More...

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def __enter__ (self)
 Return the subprocess. More...
 
def __exit__ (self, type_, value, traceback)
 
def is_orphan (self, pid_dir)
 Returns tuple (pid, cmdline-list) of orphan or (None, None) More...
 
def kill_orphan (self, pid)
 Try to kill orphan nicely first, if non-responding kill it hard. More...
 

Public Attributes

 pgid
 
 subproc
 

Detailed Description

Use instead of popen to perform cleanup of orphan subprocesses.

Arguments are exactly like popen.

This is done by tracing the processes using a unique environment variable.

Constructor & Destructor Documentation

◆ __init__()

def etr.tools.subprocess.KillOrphansContextManager.__init__ (   self,
args,
**  kwargs 
)

Member Function Documentation

◆ __enter__()

def etr.tools.subprocess.KillOrphansContextManager.__enter__ (   self)

Return the subprocess.

◆ __exit__()

def etr.tools.subprocess.KillOrphansContextManager.__exit__ (   self,
  type_,
  value,
  traceback 
)

◆ is_orphan()

def etr.tools.subprocess.KillOrphansContextManager.is_orphan (   self,
  pid_dir 
)

Returns tuple (pid, cmdline-list) of orphan or (None, None)

◆ kill_orphan()

def etr.tools.subprocess.KillOrphansContextManager.kill_orphan (   self,
  pid 
)

Try to kill orphan nicely first, if non-responding kill it hard.

Member Data Documentation

◆ pgid

etr.tools.subprocess.KillOrphansContextManager.pgid

◆ subproc

etr.tools.subprocess.KillOrphansContextManager.subproc

The documentation for this class was generated from the following file: