First we tell Supervisor to look for any new or changed program configurations in the /etc/supervisor/conf. Once our configuration file is created and saved, we can inform Supervisor of our new program through the supervisorctl command. The Supervisor documentation lists many more optional configuration options that are available to tune how programs are run. The configuration we have created here is a minimal template for a Supervisor program. The specified directories must already exist, as Supervisor will not attempt to create any missing directories. As suggested by the option names, stdout and stderr will be directed to the stdout_logfile and stderr_logfile locations respectively. The final two lines define the locations of the two main log files for the program. To learn more about error codes, look into the errno command. unexpected tells Supervisor to only restart the program if it exits with an unexpected error code (by default anything other than codes 0 or 2).true tells Supervisor to always restart the program after it exits.false tells Supervisor not to ever restart the program after it exits.Setting this to false will require a manual start following any system shutdown.Īutorestart defines how Supervisor should manage the program in the event that it exits: The autostart option tells Supervisor that this program should be started when the system boots. The next two lines define the automatic behavior of the script under certain conditions. The configuration begins by defining a program with the name idle and the full path to the program: autostart=true We’ll review this line by line: command=/home/ubuntu/idle.sh etc/supervisor/conf.d/nf command=/home/ubuntu/idle.sh The supervisor service runs automatically after installation. sudo apt update & sudo apt install supervisor. ![]() The first was a day trip to Switzerland, and the second was a weekend in Bordeaux, France. latest, full-featured, full-featured-2.6.1 alpine, alpine-2.6.1 full-featured-2.6 alpine-2.6 full-featured-2. Supported tags and respective Dockerfile links. You can learn more about how to set up a user with these privileges in our Initial Server Setup with Ubuntu 20.04 guide.īegin by updating your package sources and installing Supervisor: In the last two weekends I finally made trips outside of Italy. We can mount local data folder for this volume. An Linux server and a non-root user with sudo privileges.In this tutorial, you will install Supervisor on a Linux server and learn how to manage Supervisor configurations for multiple applications. Supervisor is a process manager which provides a singular interface for managing and monitoring a number of long-running programs. However, for software that isn’t well-packaged, or for users who would prefer not to interact with a low-level init system on their server, it is helpful to have a lightweight alternative. Usually, external packages are supplied with a unit file that allows them to be managed by an init system such as systemd, or packaged as docker images which can be managed by a container engine. In many VPS environments, it is often the case that you will have a number of small programs that you want to run persistently, whether these are small shell scripts, Node.js apps, or any large-sized packages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |