Process manager: definition and meaning
A process manager starts programs, tracks them, captures their output, and decides what happens when they exit: restart, stay stopped, or report the failure. Many run in the background, so a server keeps going without an open terminal tab.
A process manager is a program whose job is to run other programs. It starts each one as a child process, records its process ID, collects what it writes to standard output and standard error, and decides what happens when the process exits: restart it, leave it stopped, or give up and report the failure.
What it does
The core duties are small and the same everywhere.
- Start a command with a chosen working directory and environment.
- Track the process ID and whether the process is still alive.
- Capture output, so you can read it later without keeping a terminal open.
- Stop the process on request. A common sequence, used by systemd and Supervisor, is to send SIGTERM, wait for a timeout, and send SIGKILL if the process is still running. A process cannot catch or ignore SIGKILL.
- Restart it according to a policy. PM2, for example, can wait longer between attempts with its
--exp-backoff-restart-delayoption.
Operating systems ship their own versions: systemd on Linux and launchd on macOS run background services, and launchd can keep a job running with its KeepAlive setting. Application-level tools such as PM2 and Supervisor do the same job for the programs of one project or one host. Procfile runners such as Foreman start every process type listed in a Procfile together.
The smallest version
This shell loop is a process manager with one rule: restart after a failure, at most five times.
restarts=0
until node server.js; do
restarts=$((restarts + 1))
[ "$restarts" -gt 5 ] && break
echo "exited, restart $restarts of 5" >&2
sleep 2
doneIt shows why real tools exist. The loop keeps no logs, does not forward a SIGTERM sent to the shell on to the child, waits a fixed two seconds every time, and cannot tell a server that is running from one that is stuck. It also runs in the foreground of the terminal you start it in.
A common confusion
A process manager is not a task runner or a process viewer. A task runner, such as an npm script, runs a command once and finishes when the command does. It does not restart the command or keep its logs. A viewer, such as top, lists processes but does not own them. A process manager is the parent of the processes it runs, so it can wait for each child to exit, collect its exit status, and act on that. It is also not a container orchestrator, such as Kubernetes, which places containers onto the machines of a cluster.
In Rig
Rig is a process manager for local dev servers. It starts the script you pick for a project, and the scripts it detects include package.json scripts, Procfile process types, docker compose up, and Artisan sidecars such as a queue worker.
- Procfile: each process type in a
Procfilebecomes a script you can pick. Rig runs the command with/bin/sh -c, or withcmd.exe /d /s /con Windows. - Ports: if a project has a port set, Rig appends
--port Nto a Procfile command and exportsPORT,VITE_PORT,HOST_PORT, andnpm_config_port. - Environment: variables come from the project’s active env profile.
- Extra scripts: other scripts can run alongside the main one.
- Agents: coding agents can start and stop projects and read logs through Rig’s MCP tools, depending on the access mode, and any write waits for an Approve click in Rig.
Related terms
- Glossary
Procfile
A Procfile is a text file named Procfile that declares an app’s process types, one per line, as a type name, a colon, and the command that runs it.
- Glossary
Sidecar process
A sidecar is a helper that runs beside a main application and supports it. In Kubernetes it is a container in the same Pod.
- Glossary
Health check
A health check is a small, repeatable request that reports whether a service is alive and able to do its job.
Sources
- systemd.service: service unit configuration
- systemd.kill: process killing procedure configuration
- Creating Launch Daemons and Agents (Apple)
- Supervisor configuration file reference
- PM2 restart strategies
- foreman(1): manage Procfile-based applications
- signal(2) Linux manual page
- sigaction(3p) Linux manual page
- Kubernetes overview
- Rig documentation: Procfile projects (script detection confirmed in Rig’s source code)
See how Rig fits in
Rig is a Mac app that starts, stops, and watches the processes in a project from one window. The knowledge base explains each part in plain language.