pman (Linux Process Manager) - marler8997/marler8997.github.io GitHub Wiki
pman
is a linux tool used to manage processes. Some of its features include
- Sending notifications when a managed process exits
- Operate on multiple processes using process ids/process names/wildcards
- Manage processes as groups
- Update a process group without having to stop/restart the processes in the group
A processSpecifier can either be a processID or a processName. A processName can optionally include the group name, for example, if you had a process named "WebServer" in group "MyServices", the processName could be "WebServer" or "MyServices.WebServer".
Note: groupName and processName cannot start with a number so they can be distinguished from process ids.
Note: groupName/processName support wildcard matching using '*'.
Command | status [processSpecifier...] |
Description | Queries the status of the processes given by processSpecifier. If no processSpecifier is given then the status of all processes is returned. |
Returns | The status of the given processes. |
Example | > status < MyServices.WebServer 2681 Running < MyServices.JetlinkSimulator 8593 Stopped < MyServices.EngineEmulation 8594 Crashed < (empty line) |
Note | If any processSpecifier contains a wildcard then the return data must include an empty line, otherwise, the empty line is not returned. |
Command | start [processSpecifier...] |
Command | stop [processSpecifier...] |
Command | reset [processSpecifier...] |
Description | Starts/Stops/Resets the processes given by processSpecifier. If no processSpecifier is given then all processes are started/stopped/reset. |
Returns | The status of the given processes (after the operation). |
Example | > start MyServices.WebServer < WebServer 8493 Started |
Example | > start MyServices.* < MyServices.WebServer 8493 AlreadyRunning < MyServices.JelinkSimulator 7592 Started < (empty line) |
Note | If any processSpecifier contains a wildcard then the return data must include an empty line, otherwise, the empty line is not returned. |
Command | create groupName processDefinition processDefinition ... (empty line) |
Description | Creates a group of process definitions. |
Returns | Success or Error: errorMessage |
Command | update groupName [create] processDefinition processDefinition ... (empty line) |
Description | Updates group of process definitions. If create is given and the process group does not exist, then it will be created. |
Returns | The status of the given processes (after the operation). |
Example | > updategroup MyServices > WebServer system("apache") > (empty line) < MyServices.WebServer 8493 NoChange < (empty line) |
TODO: create format for a processDefinition
WebServer system("apache /etc/apache.conf")
JetlinkSimulator system("mono /root/test_tools/jlvm/app/JetlinkVirtualMachine.exe")