Supervisor enables you to use programs that need to run all the time on your Hypernode. These (usually long running) programs should not fail if there is an error. To accomplish this Supervisor watches your programs and restarts them if they might fail. Supervisor works great for use cases where a web hook or metrics always needs to run.

How to use Supervisor?

Before we start using Supervisor we first need to enable it on the Hypernode.

To test if Supervisor is properly running the following command should open Supervisor.

To store the long running programs we create a folder on the Hypernode.

In this folder we create a program that we want to keep running no matter what. For this example we create a simple Python program that will crash every 10 seconds.

And the contents of our test program.

We can test if our test program works.

If our program works we can add it to Supervisor. To do this we add a config file in the folder /data/web/supervisor. This file needs to have the *.conf extension.

We need a name for the program and a command for Supervisor to run, so we fill the config file with the following content.

Supervisor does not yet know about the programs existence. For Supervisor to run the program we add it to Supervisor.

To check if the application is really running you can check the status command, this command should show the uptime resetting every 10 seconds. For a more detailed log of how the program is running the log files can be found in /data/var/log/supervisor/ or in a specified file by using stdout_logfile= and stderr_logfile= in the config file.

Now you can create long running programs on your Hypernode.