title: How to make Supervisord read bash environment variables
body: <p>I am using Supervisord to run my java application, which requires some environment variables for configuration.
  I am setting the environment variables in <strong>/etc/environment</strong></p>
  
  <pre><code>export MANAGER_URL="http://192.xxx.xxx.xxx:8080/manager/"
  export MANAGER_URL2="http://192.xxx.xxx.yyy:8081/manager/"
  </code></pre>
  
  <p>My <strong>supervisor/conf.d/myjavaapp.conf</strong> looks like:</p>
  
  <pre><code>[supervisord]
  nodaemon=false
  logfile_maxbytes=100MB
  logfile_backups=0
  
  [program:java-app]
  command=/usr/bin/java -jar /home/pi/deploy/java-app.jar
  stdout_logfile_maxbytes=200MB
  stdout_logfile_backups=2
  stderr_logfile_maxbytes=100MB
  stderr_logfile_backups=0
  autostart=true
  </code></pre>
  
  <p>I know i can set the environment variables for the <em>[java-app]</em> section as:</p>
  
  <pre><code>environment=MANAGER_URL="url1",MANAGER_URL2="url2" 
  </code></pre>
  
  <p>but that does not work for me as I need to update the variable values using Puppet manifest, which can update the bash environment variables but not the supervisor sub process environment variables.</p>
  
  <p>I tried accessing the shell environment variables using:</p>
  
  <pre><code>environment=MANAGER_URL=%(MANAGER_URL)s,MANAGER_URL2=%(MANAGER_URL2)s
  </code></pre>
  
  <p>but this resulted in an error saying the strings could not be expanded.</p>
  
  <p>Is there someway I can read the bash environment variables in my <strong>supervisor.conf</strong>?</p>
  
  <p><em>Extra Info:</em><br>
  I am running it on <strong>raspbian</strong><br>
  Supervisord is run at startup by systemd using the script in /etc/init.d/<br>
  Puppet agent is also run by Supervisor so it cannot restart the Supervisor service</p>