Supervisor / supervisor

Supervisor process control system for Unix (supervisord)
http://supervisord.org
Other
8.34k stars 1.23k forks source link

Which path to specify as `directory` when scripts are a python package? #1556

Closed kernelguardian closed 1 year ago

kernelguardian commented 1 year ago

I have packaged my python scripts into a python package, this gets installed inside a docker container. When I start supervisord with the configuration file, supervisord expects a directory path to where my source code is located. I am confused to point to which path for this.

mnaberez commented 1 year ago

When I start supervisord with the configuration file, supervisord expects a directory path to where my source code is located.

No version of Supervisor (in the current version 4.2.4 or below) looks in directory= for the executable specified in command=. The directory= is only used to set the current working directory before the command fork/exec'ed. The executable in command= can be an absolute or relative path. If it is a relative path, supervisord searches for the executable in the PATH of the environment from which supervisord was started.

supervisord doesn't have any special knowledge of Python scripts or packages. supervisord can run a Python interpreter as the command, e.g. command = python /path/to/a/script.py, but this isn't any different from supervisord's perspective than command = /bin/cat or any other executable.

The correct values for command= and directory= are specific to each program and system. The Supervisor developers don't have enough bandwidth to assist installing individual programs under supervisord, sorry.

kernelguardian commented 1 year ago

This makes sense, thank you @mnaberez