# Title: supervisor environment varaibles broken on ubuntu18.04 # Subject: the packaged supervisor-3.3.1 does not respect environemtn variables I am using supervisor to manage a few daemons. I use environemnt variables to avoid hard coding paths. Supervisor-3.2 and newer support this: Environemnt variable X is accessable in supervisor config file via %(ENV_X)s I installed supervisor 3.3.1-1.1 via the ubuntu 18.04 lts package apt install supervisor This generated the following files in etc: 1. /etc/init.d/supervisor 2. /etc/systemd/system/multi-user.target.wants/supervisor.service 3. /etc/supervisor/supervisord.conf 4. /etc/supervisor/conf.d 5. /etc/default/supervisor Description of files: 1. is the legacy non-systemd init (not used) 2. is the systemd init (is used) 3. is the supervisor daemon config 4. is directory holing supervised damon configs 5. is an environemnet file, not used by systemd. I must be able to feed environment variables to supervisord. The file /etc/default/supervisor is there to serve this purpose: sudo vi /etc/default/supervisor Add: INST_USER="my_user" INST_PATH="/var/www/wsgi/app" I see /etc/init.d/supervisor sources /etc/default/supervisor. Problem: The systemd service file ignores /etc/default/supervisor. Solution: Edit the systemd service file, and add a line to look at /etc/default/supervisor sudo vi /etc/systemd/system/multi-user.target.wants/supervisor.service Under: [Service] Add: EnvironmentFile=-/etc/default/supervisor systemctl daemon-reload systemctl restart supervisor systemctl status supervisor