Functions | |
def | getPiDict (port, appname='salome', full=True, hidden=True, hostname=None) |
def | appliCleanOmniOrbConfig (port) |
def | shutdownMyPort (port, cleanup=True) |
def | __killProcesses (processes) |
def | __killPids (pids) |
def | __killMyPort (port, filedict) |
def | __guessPiDictFilename (port) |
def | killProcessSSL (port, pids_list) |
def | killMyPort (*ports) |
def | cleanApplication (port) |
def | killMyPortSpy (pid, port) |
def | __checkUnkilledProcesses () |
def | killUnkilledProcesses () |
def | main () |
Variables | |
logger = logging.getLogger() | |
|
private |
Check all unkilled SALOME processes (internal). :return: list of unkilled processes
References salome_utils.getUserName().
Referenced by killUnkilledProcesses(), and main().
|
private |
Guess and return pidict file for given `port` (internal). :param port : port number :return pidict file's path
References SalomeOnDemandTK.extension_utilities.format, salome_utils.getHostName(), getPiDict(), Utils_Identity.getShortHostName(), and virtual_salome.verbose.
Referenced by killMyPort().
|
private |
Kill processes for given port (internal). :param port : port number :param filedict : pidict file
References __killPids(), and SalomeOnDemandTK.extension_utilities.format.
Referenced by killMyPort(), and shutdownMyPort().
|
private |
Kill processes with given `pids`. :param pids : processes IDs
References __killProcesses(), and SalomeOnDemandTK.extension_utilities.format.
Referenced by __killMyPort(), and killProcessSSL().
|
private |
Terminate and kill all given processes (inernal). :param processes : list of processes, each one is an instance of psutil.Process
Referenced by __killPids(), and killUnkilledProcesses().
def killSalomeWithPort.appliCleanOmniOrbConfig | ( | port | ) |
Remove omniorb config files related to given `port` in SALOME application: - ${OMNIORB_USER_PATH}/.omniORB_${USER}_${HOSTNAME}_${NSPORT}.cfg - ${OMNIORB_USER_PATH}/.omniORB_${USER}_last.cfg the last is removed only if the link points to the first file. :param port : port number
References SalomeOnDemandTK.extension_utilities.format, salome_utils.generateFileName(), and salome_utils.getUserName().
Referenced by cleanApplication(), killMyPort(), and killProcessSSL().
def killSalomeWithPort.cleanApplication | ( | port | ) |
Clean application running on the specified port. :param port : port number
References appliCleanOmniOrbConfig(), and getPiDict().
def killSalomeWithPort.getPiDict | ( | port, | |
appname = 'salome' , |
|||
full = True , |
|||
hidden = True , |
|||
hostname = None |
|||
) |
Get path to the file that stores the list of SALOME processes. This file is located in the user's home directory and named .<user>_<host>_<port>_SALOME_pidict where - <user> is user name - <host> is host name - <port> is port number :param port : port number :param appname : application name (default: 'salome') :param full : if True, full path to the file is returned, otherwise only file name is returned :param hidden : if True, file name is prefixed with . (dot) symbol; this internal parameter is only used to support compatibility with older versions of SALOME :param hostname : host name (if not given, it is auto-detected) :return pidict file's name or path
References salome_utils.generateFileName(), and salome_utils.getLogDir().
Referenced by __guessPiDictFilename(), addToKillList.addToKillList(), cleanApplication(), killSalome.killAllPorts(), addToKillList.killList(), killMyPort(), killMyPortSpy(), killProcessSSL(), shutdownMyPort(), runSalome.useSalome(), and runSalomeOld.useSalome().
def killSalomeWithPort.killMyPort | ( | * | ports | ) |
Kill SALOME session running on the specified port. :param ports : port numbers
References __guessPiDictFilename(), __killMyPort(), appliCleanOmniOrbConfig(), SalomeOnDemandTK.extension_utilities.format, getPiDict(), PortManager.releasePort(), and virtual_salome.verbose.
Referenced by runSalomeOld.foreGround(), runSalomeOld.givenPortKill(), killSalome.killAllPorts(), runSalomeOld.killLocalPort(), killMyPortSpy(), and main().
def killSalomeWithPort.killMyPortSpy | ( | pid, | |
port | |||
) |
Start daemon process which watches for given process and kills session when process exits. :param pid : process ID :param port : port number (to kill)
References getPiDict(), killMyPort(), and salome_utils.killPid().
Referenced by main().
def killSalomeWithPort.killProcessSSL | ( | port, | |
pids_list | |||
) |
Called by runSalome.py after CTRL-C. This method : - Kill all PIDS in pids - update file of pidict
References __killPids(), appliCleanOmniOrbConfig(), SalomeOnDemandTK.extension_utilities.format, and getPiDict().
Referenced by runSalome.foreGround().
def killSalomeWithPort.killUnkilledProcesses | ( | ) |
Kill processes which could remain even after shutdowning SALOME sessions.
References __checkUnkilledProcesses(), and __killProcesses().
Referenced by killSalome.killAllPorts().
def killSalomeWithPort.main | ( | void | ) |
Main function
References __checkUnkilledProcesses(), SalomeOnDemandTK.extension_utilities.format, killMyPort(), killMyPortSpy(), salomeContextUtils.setOmniOrbUserPath(), and virtual_salome.verbose.
def killSalomeWithPort.shutdownMyPort | ( | port, | |
cleanup = True |
|||
) |
Shutdown SALOME session running on the specified port. :param port : port number :param cleanup : perform additional cleanup actions (kill omniNames, etc.)
References __killMyPort(), SalomeOnDemandTK.extension_utilities.format, salome_utils.generateFileName(), getPiDict(), salome_utils.killOmniNames(), PortManager.releasePort(), and virtual_salome.verbose.
killSalomeWithPort.logger = logging.getLogger() |