Dotcloud supervisord.conf file environment specification

http://docs.dotcloud.com/guides/daemons/ :

Configuring The Environment
You can easily modify the environment of execution of your daemon with the "directory" and "environment" directives to change the directory where the command is executed and to define additional environment variable. For example:

[program:daemonname]
command = php my_daemon.php
directory = /home/dotcloud/current/
environment = QUEUE=*, VERBOSE=TRUE

However, I believe that my PYTHONPATH environment variable is not set:

dotcloud.yml:

www:
  type: python
db:
  type: postgresql
worker:
  type: python-worker

supervisord.conf:

[program:apnsd]
command=/home/dotcloud/current/printenv.py
environment=PYTHONPATH=/home/dotcloud/current/apnsd/

printenv.py

#! /home/dotcloud/env/bin/python
import os
print "ENVIRONMENT"
print os.environ

magazines:

    ENVIRONMENT
    {'SUPERVISOR_ENABLED': '1', 'SUPERVISOR_SERVER_URL': 'unix:///var/dotcloud/super
    visor.sock', 'VERBOSE': 'no', 'UPSTART_INSTANCE': '', 'PYTHONPATH': '/', 'PREVLE
    VEL': 'N', 'UPSTART_EVENTS': 'runlevel', '/': '/', 'SUPERVISOR_PROCESS_NAME': 'a
    pnsd', 'UPSTART_JOB': 'rc', 'PWD': '/', 'SUPERVISOR_GROUP_NAME': 'apnsd', 'RUNLE
    VEL': '2', 'PATH': '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    ', 'runlevel': '2', 'previous': 'N'}

Do not show modified python variable!

+3
source share
1 answer

There is an error in Supervisor; some variables (for example, those that contain /) must be specified.

In this case, you need to:

[program:apnsd]
command=/home/dotcloud/current/printenv.py
environment= PYTHONPATH="/home/dotcloud/current/apnsd/"

(A space in = PYTHONPATHis optional, it's just to make the file a little readable, but you need quotes around the value PYTHONPATH!)

I am updating the dotCloud documentation to mention this issue.

+3
source