1001Ferramentas
👷 Dev

Supervisord Program Generator

Create a [program:name] section for supervisord with command, autostart, autorestart, stdout_logfile and environment.

Keeping a process up with Supervisor

Supervisor is a process manager written in Python that predates systemd taking hold. It stays in use for practical reasons: it runs without root privileges, behaves identically across distributions and inside containers, and its configuration is a simple INI file rather than a unit with dozens of directives.

Fill in the name, the command, the user and the working directory, and the page assembles the program block. The two options that matter are starting alongside supervisor and restarting automatically on exit — together they give the behaviour almost everyone wants from a service. Environment variables go on a line of their own.

Two details cause trouble regularly. The command must run in the foreground: a process that daemonises itself fools supervisor, which loses track of it and keeps restarting forever. And the command runs without a shell, so pipes, redirection and variable expansion do not work there — when they are needed, the route is invoking the shell explicitly.

Frequently asked questions

Supervisor or systemd?
On a Linux machine with systemd available, systemd is usually the better choice: it is already there, integrates with the system journal and handles dependencies between services. Supervisor wins when you have no root, when you need identical configuration across different systems, or inside a container, where there is no systemd.
Why does my process restart endlessly?
Most often because it daemonises: the process supervisor launched exits immediately, the real child is orphaned, and supervisor concludes it died. The fix is whichever option keeps your program in the foreground — nearly every server has one.
Where do the logs go?
By default into separate files for output and errors, in the configured log directory, with rotation by size. It is worth tuning the size and the number of retained files: the defaults are modest and, on a chatty service, useful history disappears quickly.

Related Tools