supervisor.getProcessInfo(namespec)
Table 2.19. supervisor.getProcessInfo() Parameters
| Type | Name | Description |
|---|---|---|
| string | namespec | Name of the group and process |
Table 2.20. supervisor.getProcessInfo() Return Value
| Type | Description |
|---|---|
| struct |
{'name': 'process name',
'group': 'group name',
'start': 1200361776,
'stop': 0,
'now': 1200361812,
'state': 1,
'statename': 'RUNNING',
'spawnerr': '',
'exitstatus': 0,
'stdout_logfile': '/path/to/stdout-log',
'stderr_logfile': '/path/to/stderr-log',
'pid': 1}
|
Returns information about a process. Supervisor maintains a table of processes under its control and can return information about them to the client at any time.
supervisor.getAllProcessInfo()
Table 2.22. supervisor.getAllProcessInfo() Return Value
| Type | Description |
|---|---|
| array | Array of structs, same as returned by supervisor.getProcessInfo(). |
supervisor.getAllProcessInfo() returns an array
containing n number of elements, where n is
the number of processes in Supervisor’s process table.
Each element contains a struct, and this
struct contains the exact same elements as the
struct returned by supervisor.getProcess(). If
the process table is empty, an empty array is returned.
supervisor.startProcess(namespec, wait=True)
Table 2.23. supervisor.startProcess() Parameters
| Type | Name | Description |
|---|---|---|
| string | namespec | Name of the group and process |
| boolean | wait | Wait for start to complete before returning? |
The supervisor.startProcess() method will start a process.
If name of the group and process (namespec argument) is
not recognized, the fault BAD_NAME will be raised.
If wait=False, the method will return immediately without
waiting for Supervisor to start the process.
If wait=True, Supervisor will attempt to start the process
and then will hold the HTTP request until the process has reached
startsecs.
If the process starts successfully, the boolean TRUE
is returned. Otherwise, the fault ABNORMAL_TERMINATION
is raised.
supervisor.stopProcessGroup(name)
Table 2.25. supervisor.stopProcessGroup() Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Group name to stop |
This method will unceremoniously kill all processes within a process group. In normal operations, processes will always terminate on their own. This method will only be used to terminate runaway processes or otherwise kill a process prematurely.
If name of the group (name argument) is not recognized,
the fault BAD_NAME will be raised.
If any process cannot be stopped then the fault FAILED
will be raised. This is abnormal and results in Supervisor being in a
potentially unstable condition.
This method is asynchronous. It will return before the processes have been killed. Once each process has been killed, they will be removed from Supervisor’s process table.
supervisor.stopProcess(namespec)
Table 2.27. supervisor.stopProcess() Parameters
| Type | Name | Description |
|---|---|---|
| string | namespec | Name of the group and process |
| string | namespec | Name of the process |
This method will unceremoniously kill a single process. In normal operations, processes will always terminate on their own. This method will only be used to terminate runaway processes or otherwise kill a process prematurely.
If namespec is not recognized, the fault BAD_NAME
will be raised.
If any process cannot be stopped then the fault FAILED
will be raised. This is abnormal and results in Supervisor being in a
potentially unstable condition.
If the wait argument is True, Supervisor will hold the
client’s HTTP request until the process has actually been killed. Once a
process has been killed, it will be removed from Supervisor’s process table.
supervisor.stopAllProcesses()
This method will unceremoniously kill all processes that are running. It
is the equivalent of calling supervisor.stopProcess() on
every running process.
If any process cannot be stopped then the fault FAILED
will be raised. This is abnormal and results in Supervisor being in a
potentially unstable condition.
This method is asynchronous. It will return before the processes have been killed. Once each process has been killed, they will be removed from Supervisor’s process table.
supervisor.sendProcessStdin(namespec, chars)
Table 2.31. supervisor.sendProcessStdin() Parameters
| Type | Name | Description |
|---|---|---|
| string | namespec | Name of the group and process |
| string | chars | Character data to push into the process’ STDIN file descriptor |
The supervisor.sendProcessStdin() method passes a string of
characters (parameter chars) into a process'
STDIN file descriptor. Supervisor does not terminate the string in
any way; it passes the string exactly as it is given in the chars
parameter. This means that a carriage return or linefeed must be
appended to the chars string itself if one needs to be sent.
If the process named by the parameter namespec is not
known by Supervisor, a fault BAD_NAME is raised.
If the process is not running or is being killed, a fault
NOT_RUNNING is raised.
