How to Install and Configure Supervisor on Ubuntu

default-user-image.png

introduce

In many server environments, it is often the case that you will have many small programs that you want to run persistently, whether those programs are small shell scripts, Node .js applications, or any large software package.

Typically, external packages come with unit files, allowing them to be managed by an init system such as systemd, or packaged as a docker image that can be managed by the container engine. However, for software that isn’t packaged well, or for users who don’t want to interact with the low-level init system on the server, it’s helpful to have a lightweight alternative.

Supervisor is a process manager that provides a single interface to manage and monitor many long-running programs. In this tutorial, you will install Supervisor on a Linux server and learn how to manage Supervisor configuration for multiple applications.

Here are the main advantages of Supervisor:

  • Convenience: It is inconvenient to write rc.d for all single-process instances. Likewise, the Rc.d script does not automatically restart a crashed process. However, Supervisor can be configured to automatically restart processes when they crash.
  • Accuracy: In UNIX, it is often difficult to get the exact start/stop status of a process. Supervisor starts a process as a child process, so it knows the up/down status of its child processes. This is easy to query for the end user.

Step 1 – Installation

This article is reprinted from https://blog.p2hp.com/archives/8582
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment