Skip to content

PM2

Common parts of every card (states, backoff, Unit and ExecReload, Test config, manual commands) are described in Monitor window.

Detected by systemd units pm2-* or binaries pm2
Read every 60 s while the Monitor window shows the tab
Active probe yes, off by default
Test config none

PM2 of the session’s account: whether its daemon runs (passive, without calling the CLI: every PM2 command starts a daemon) and, as the active probe, pm2 jlist reduced on the host by json.awk to a closed list of paths (never pm2_env.env, args or other parts of pm2_env, which hold the whole environment of the application).

Runs: pm2 jlist of the session’s account every minute while the Monitor is open, only when its PM2 daemon already runs (any PM2 command would otherwise start a daemon and create /.pm2): ${PM2_HOME:-/.pm2} and its rpc.sock belong to this account, pm2.pid names a process of this account whose command line is “God Daemon (<PM2_HOME>)”, and that process holds the one listening unix socket bound to rpc.sock (/proc/net/unix and its open files). pm2 must be trusted (owner root or this account, not writable by others; on a root session only root’s), and its package directory (readlink -f of pm2, two levels up) may hold nothing owned by another account or writable by group or others (find under timeout 3 s). Run as /usr/bin/env -i HOME=$HOME PM2_HOME=<home> PATH=/usr/bin:/bin <node> <pm2> jlist, where <node> is the first trusted of <pm2’s directory>/node, /usr/bin/node, /usr/local/bin/node; GNU or BusyBox timeout 10 s, at most 2 MiB read, json.awk under timeout 5 s. On the host json.awk keeps only name, pm_id, pid, monit.memory, monit.cpu and pm2_env.status, restart_time, unstable_restarts, pm_uptime, exec_mode; the environment, arguments and paths of the applications stay on the host. PM2 of other accounts is not read

Traces on the host: one connection to the daemon’s rpc.sock per run (a short node process for the CLI); PM2 logs nothing for jlist; a race remains: if the daemon stops between the check and the call, pm2 starts a new one

None: KryoDesk has no configuration test for this service.

Scroll or pinch to zoom · drag to move · double-click to zoom · Esc or click outside to close