Skip to main content
PM2 is an optional process supervisor that keeps the Comis daemon running in the background and provides restart, status, and log commands. The managed Linux installer uses systemd by default; PM2 is useful on macOS, WSL, or Linux systems where systemd is unavailable.

Prerequisites

  • Node.js 22.19.0 or newer
  • Comis installed and initialized
  • PM2 available on PATH:
When working from a source checkout, run pnpm build before PM2 setup. Published Comis packages already include the built daemon.

Set up and start

1

Generate the process definition

This writes ~/.comis/ecosystem.config.js with the installed daemon path, the active COMIS_CONFIG_PATHS value, a 512 MiB Node.js heap limit, and the restart policy.
2

Start the daemon

3

Verify status and logs

Commands

After upgrading or rebuilding Comis, run comis pm2 setup again if the installed daemon path changed, then run comis pm2 restart.

Start at boot

To have PM2 restore Comis after reboot, run:
PM2 may request sudo to register with launchd or systemd. If automatic registration cannot complete, the command prints the manual PM2 step to run.

Generated configuration

The generated file is owned by the current user and written with mode 0600. Its shape is:
Do not rely on a separately exported COMIS_CONFIG_PATHS; the generated PM2 definition carries the value into the background process.

Logs

comis pm2 logs streams PM2 output. PM2 also stores its own log files under ~/.pm2/logs/. To control PM2 log retention, install and configure pm2-logrotate; Comis’s structured file logs have separate rotation settings in Logging.

systemd

The default managed-service path on Linux.

Daemon

Daemon lifecycle and health checks.

Logging

Configure structured daemon logs and rotation.

Troubleshooting

Diagnose startup and supervisor issues.