Browse Source

Recommend quoting the values in environment= examples

Mike Naberezny 12 years ago
parent
commit
a5c1dc3f58
2 changed files with 20 additions and 17 deletions
  1. 17 14
      docs/configuration.rst
  2. 3 3
      supervisor/skel/sample.conf

+ 17 - 14
docs/configuration.rst

@@ -363,15 +363,17 @@ follows.
 
 
 ``environment``
 ``environment``
 
 
-  A list of key/value pairs in the form ``KEY=val,KEY2=val2`` that
+  A list of key/value pairs in the form ``KEY="val",KEY2="val2"`` that
   will be placed in the :program:`supervisord` process' environment
   will be placed in the :program:`supervisord` process' environment
   (and as a result in all of its child process' environments).  This
   (and as a result in all of its child process' environments).  This
   option can include the value ``%(here)s``, which expands to the
   option can include the value ``%(here)s``, which expands to the
   directory in which the supervisord configuration file was found.
   directory in which the supervisord configuration file was found.
-  Note that subprocesses will inherit the environment variables of the
-  shell used to start :program:`supervisord` except for the ones
-  overridden here and within the program's ``environment``
-  configuration stanza.  See :ref:`subprocess_environment`.
+  Values containing non-alphanumeric characters should be quoted
+  (e.g. ``KEY="val:123",KEY2="val,456"``).  Otherwise, quoting the
+  values is optional but recommended.  **Note** that subprocesses will
+  inherit the environment variables of the shell used to start
+  :program:`supervisord` except for the ones overridden here and within
+  the program's ``environment`` option. See :ref:`subprocess_environment`.
 
 
   *Default*: no values
   *Default*: no values
 
 
@@ -411,7 +413,7 @@ follows.
    nocleanup = true
    nocleanup = true
    childlogdir = /tmp
    childlogdir = /tmp
    strip_ansi = false
    strip_ansi = false
-   environment = KEY1=value1,KEY2=value2
+   environment = KEY1="value1",KEY2="value2"
 
 
 ``[supervisorctl]`` Section Settings
 ``[supervisorctl]`` Section Settings
 ------------------------------------
 ------------------------------------
@@ -911,16 +913,17 @@ where specified.
 
 
 ``environment``
 ``environment``
 
 
-  A list of key/value pairs in the form ``KEY=val,KEY2=val2`` that
+  A list of key/value pairs in the form ``KEY="val",KEY2="val2"`` that
   will be placed in the child process' environment.  The environment
   will be placed in the child process' environment.  The environment
   string may contain Python string expressions that will be evaluated
   string may contain Python string expressions that will be evaluated
   against a dictionary containing ``group_name``, ``host_node_name``,
   against a dictionary containing ``group_name``, ``host_node_name``,
   ``process_num``, ``program_name``, and ``here`` (the directory of the
   ``process_num``, ``program_name``, and ``here`` (the directory of the
   supervisord config file).  Values containing non-alphanumeric characters
   supervisord config file).  Values containing non-alphanumeric characters
-  should be placed in quotes (e.g. ``KEY="val:123",KEY2="val,456"``) **Note**
-  that the subprocess will inherit the environment variables of the
-  shell used to start "supervisord" except for the ones overridden
-  here.  See :ref:`subprocess_environment`.
+  should be quoted (e.g. ``KEY="val:123",KEY2="val,456"``).  Otherwise,
+  quoting the values is optional but recommended.  **Note** that the
+  subprocess will inherit the environment variables of the shell used to
+  start "supervisord" except for the ones overridden here.  See
+  :ref:`subprocess_environment`.
 
 
   *Default*: No extra environment
   *Default*: No extra environment
 
 
@@ -996,7 +999,7 @@ where specified.
    stderr_logfile_maxbytes=1MB
    stderr_logfile_maxbytes=1MB
    stderr_logfile_backups=10
    stderr_logfile_backups=10
    stderr_capture_maxbytes=1MB
    stderr_capture_maxbytes=1MB
-   environment=A=1,B=2
+   environment=A="1",B="2"
    serverurl=AUTO
    serverurl=AUTO
 
 
 ``[include]`` Section Settings
 ``[include]`` Section Settings
@@ -1219,7 +1222,7 @@ above constraints and additions.
    stderr_logfile=/a/path
    stderr_logfile=/a/path
    stderr_logfile_maxbytes=1MB
    stderr_logfile_maxbytes=1MB
    stderr_logfile_backups
    stderr_logfile_backups
-   environment=A=1,B=2
+   environment=A="1",B="2"
 
 
 ``[eventlistener:x]`` Section Settings
 ``[eventlistener:x]`` Section Settings
 --------------------------------------
 --------------------------------------
@@ -1295,7 +1298,7 @@ above constraints and additions.
    stderr_logfile=/a/path
    stderr_logfile=/a/path
    stderr_logfile_maxbytes=1MB
    stderr_logfile_maxbytes=1MB
    stderr_logfile_backups
    stderr_logfile_backups
-   environment=A=1,B=2
+   environment=A="1",B="2"
 
 
 ``[rpcinterface:x]`` Section Settings
 ``[rpcinterface:x]`` Section Settings
 -------------------------------------
 -------------------------------------

+ 3 - 3
supervisor/skel/sample.conf

@@ -33,7 +33,7 @@ minprocs=200                 ; (min. avail process descriptors;default 200)
 ;directory=/tmp              ; (default is not to cd during start)
 ;directory=/tmp              ; (default is not to cd during start)
 ;nocleanup=true              ; (don't clean up tempfiles at start;default false)
 ;nocleanup=true              ; (don't clean up tempfiles at start;default false)
 ;childlogdir=/tmp            ; ('AUTO' child log dir, default $TEMP)
 ;childlogdir=/tmp            ; ('AUTO' child log dir, default $TEMP)
-;environment=KEY=value       ; (key value pairs to add to environment)
+;environment=KEY="value"     ; (key value pairs to add to environment)
 ;strip_ansi=false            ; (strip ansi escape codes in logs; def. false)
 ;strip_ansi=false            ; (strip ansi escape codes in logs; def. false)
 
 
 ; the below section must remain in the config file for RPC
 ; the below section must remain in the config file for RPC
@@ -82,7 +82,7 @@ serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL  for a unix socket
 ;stderr_logfile_backups=10     ; # of stderr logfile backups (default 10)
 ;stderr_logfile_backups=10     ; # of stderr logfile backups (default 10)
 ;stderr_capture_maxbytes=1MB   ; number of bytes in 'capturemode' (default 0)
 ;stderr_capture_maxbytes=1MB   ; number of bytes in 'capturemode' (default 0)
 ;stderr_events_enabled=false   ; emit events on stderr writes (default false)
 ;stderr_events_enabled=false   ; emit events on stderr writes (default false)
-;environment=A=1,B=2           ; process environment additions (def no adds)
+;environment=A="1",B="2"       ; process environment additions (def no adds)
 ;serverurl=AUTO                ; override serverurl computation (childutils)
 ;serverurl=AUTO                ; override serverurl computation (childutils)
 
 
 ; The below sample eventlistener section shows all possible
 ; The below sample eventlistener section shows all possible
@@ -118,7 +118,7 @@ serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL  for a unix socket
 ;stderr_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)
 ;stderr_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)
 ;stderr_logfile_backups        ; # of stderr logfile backups (default 10)
 ;stderr_logfile_backups        ; # of stderr logfile backups (default 10)
 ;stderr_events_enabled=false   ; emit events on stderr writes (default false)
 ;stderr_events_enabled=false   ; emit events on stderr writes (default false)
-;environment=A=1,B=2           ; process environment additions
+;environment=A="1",B="2"       ; process environment additions
 ;serverurl=AUTO                ; override serverurl computation (childutils)
 ;serverurl=AUTO                ; override serverurl computation (childutils)
 
 
 ; The below sample group section shows all possible group values,
 ; The below sample group section shows all possible group values,