Configs2026年7月28日·1 分钟阅读

Supervisord — Process Control System for Unix

A client/server system for controlling processes on Unix-like operating systems. Supervisord starts, stops, and monitors long-running processes and automatically restarts them on failure.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Supervisord
先审查命令
npx -y tokrepo@latest install e3fa3c89-8aa2-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

Introduction

Supervisor is a process control system for Unix that lets you manage and monitor long-running processes. It automatically starts processes at boot, restarts them on crash, and provides a CLI and web interface for managing process groups. It is widely used to run application servers, workers, and background tasks in production.

What Supervisord Does

  • Starts, stops, and restarts managed processes with automatic crash recovery
  • Groups related processes for batch control (start/stop a service stack at once)
  • Provides a CLI tool (supervisorctl) for interactive process management
  • Exposes a web UI and XML-RPC API for remote monitoring
  • Logs stdout and stderr from managed processes to rotated log files

Architecture Overview

Supervisord runs as a daemon (the server process) that reads an INI-style configuration file defining programs and their parameters. Each managed program runs as a child process. The daemon monitors child processes via SIGCHLD signals and restarts them according to the configured policy. The supervisorctl client communicates with the daemon over a Unix socket or TCP using XML-RPC.

Self-Hosting & Configuration

  • Install via pip: pip install supervisor
  • Generate a config template: echo_supervisord_conf > /etc/supervisord.conf
  • Define programs in [program:name] sections with command, directory, and user
  • Set autorestart=true for automatic crash recovery
  • Enable the web UI by configuring [inet_http_server] with a port and credentials

Key Features

  • Automatic process restart on crash or exit
  • Process groups for managing related services together
  • Built-in log rotation for stdout and stderr
  • Event listeners for custom notifications on process state changes
  • Web dashboard for real-time status monitoring

Comparison with Similar Tools

  • systemd — Linux-native init system; Supervisord is cross-platform and simpler to configure
  • PM2 — Node.js-focused process manager with clustering; Supervisord is language-agnostic
  • Docker — Container-level process management; Supervisord manages processes within a single host or container
  • runit — Minimal init scheme; Supervisord offers richer monitoring and a web UI

FAQ

Q: Can Supervisord manage Docker containers? A: Supervisord manages Unix processes, not containers. It is often used inside Docker containers to run multiple processes in a single container when needed.

Q: How does Supervisord handle process dependencies? A: Use priority values to control start order and process_groups to manage related services. For strict dependency ordering, use event listeners or startup scripts.

Q: Does Supervisord work on macOS? A: Yes. Supervisord runs on any Unix-like system including macOS and Linux. It does not support Windows natively.

Q: Can I extend Supervisord with plugins? A: Yes. Supervisord supports event listeners that react to process state changes, and third-party plugins like superlance add advanced monitoring features.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产