sajad torkamani

In a nutshell

  • A process control system for Unix.
  • Shares some goals of tools like launchd but the main difference is that it’s not meant to be run as a substitute for init as “process id 1”. Instead, it’s intended to start like any other program at boot time but is used to control processes related to a project.
  • Starts processes as child processes of the main process.
  • It lets you group processes as a single unit.
  • It lets you control the order in which processes start.
  • Programs (e.g., Nginx or PHP-FPM) running under supervisor should be run in the foreground and not be daemonized.

Components

supervisord

Server component responsible for starting child programs, responding to commands from clients, restarting exited/crashed subprocesses, etc.

Managed via a INI config file, usually at /etc/supervisord.conf.

supervisorctl

Client program that can communicate with supervisord to start or stop subprocesses. Talks to supervisor d via Unix domain socket or TCP socket.

Web server

A minimal web UI that provides functionality similar to supervisorctl. Available if you start supervisord via a TCP socket.

XML-RPC interface

You can use this interface to view the status of supervisor and manage its processes.

Installation

Install package

apt-get supervisor

Create initial config:

echo_supervisord_conf > /etc/supervisord.con

Basic usage

Start supervisord in the background

supervisord

See options for more control.

Start supervisorctl in interactive mode

supervisorctl

See list of actions available.

Get the status of processes

supervisorctl status all

Sources

Tagged: Unix