How to use supervisord’s environment option in program sections

supervisord

The supervisord documentation states that

No shell is executed by supervisord when it runs a subprocess, so
environment variables such as USER, PATH, HOME, SHELL, LOGNAME, etc.
are not changed from their defaults or otherwise reassigned. (…)
If you need to set environment variables for a
particular program that might otherwise be set by a shell invocation
for a particular user, you must do it explicitly within the
environment= program config option.

The include an example, which I reproduced into /etc/supervisor/conf.d/apache2.conf:

[program:apache2]
command=/home/chrism/bin/httpd -c "ErrorLog /dev/stdout" -DFOREGROUND
user=chrism
environment=HOME=/home/chrism,USER=chrism

However,

# supervisorctl reread
ERROR: CANT_REREAD: Unexpected end of key/value pairs

Removing the 'environment' line of the apache2 configuration results in no parse errors for the re-read. What's dotty here? I'm using supervisor 3.0a8-1 on Debian Squeeze and note that the mainline supervisor is 3.0a10; I cannot find reference of environment has having been added since 3.0a8

Best Answer

http://supervisord.org/configuration.html#program-x-section-settings

says "Values containing non-alphanumeric characters should be placed in quotes"