Index: trunk/docs/kernel/configuration.rst
===================================================================
--- trunk/docs/kernel/configuration.rst	(revision 771)
+++ trunk/docs/kernel/configuration.rst	(revision 772)
@@ -158,7 +158,7 @@
 ...............................
 
-The ``lenv`` can be used to store runtime informations automatically
-set by ZOO-Kernel before and during the execution of a WPS service,
-with the following parameters:
+The ``lenv`` section is used by the ZOO-Kernel to store runtime informations
+before the execution of a WPS service, it contains the following
+parameters:
 
  * ``sid`` (r): The WPS Service unique identifier,
@@ -169,4 +169,20 @@
  * ``cookie`` (rw): The cookie to be returned to the client (for
    example for authentication purpose).
+ * ``file.pid`` (r): The file used by the ZOO-Kernel to store process identifier.
+ * ``file.sid`` (r): The file used by the ZOO-Kernel to store service identifier.
+ * ``file.responseInit`` (r): The file used by the ZOO-Kernel to store
+   the initial (then final) WPS response.
+ * ``file.responseFinal`` (r): The file used by the ZOO-Kernel to
+   temporary store the final WPS response.
+
+renv section
+...............................
+
+The ``renv`` section is automatically created by the ZOO-Kernel before
+the execution of a WPS service, it contains all the environment
+variables available at runtime (so including the header fields in case
+it is used through http, refer to [https://tools.ietf.org/html/rfc3875
+rfc3875] for more details).
+
 
 senv section
Index: trunk/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 771)
+++ trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 772)
@@ -102,4 +102,8 @@
 #include <time.h>
 #include <stdarg.h>
+
+#ifndef WIN32
+extern char **environ;
+#endif
 
 #ifdef WIN32
@@ -1974,4 +1978,31 @@
   dumpMap (request_inputs);
 #endif
+
+  int ei = 1;
+  char *s = 
+#ifdef WIN32
+    GetEnvironmentStrings();
+#else
+    *environ;
+#endif
+  _tmpMaps = (maps *) malloc (MAPS_SIZE);
+  _tmpMaps->name = zStrdup ("renv");
+  _tmpMaps->content = NULL;
+  _tmpMaps->next = NULL;
+  for (; s; ei++) {
+    char* tmpName=zStrdup(s);
+    char* tmpValue=strstr(s,"=")+1;
+    tmpName[strlen(tmpName)-strlen(tmpValue)-1]=0;
+    if(_tmpMaps->content == NULL)
+      _tmpMaps->content = createMap (tmpName,tmpValue);
+    else
+      addToMap (_tmpMaps->content,tmpName,tmpValue);
+    free(tmpName);
+    s = *(environ+ei);
+  }
+  addMapsToMaps (&m, _tmpMaps);
+  freeMaps (&_tmpMaps);
+  free (_tmpMaps);
+
 #ifdef WIN32
   char *cgiSidL = NULL;
@@ -2091,4 +2122,5 @@
                      strlen (usid->value) + 7) * sizeof (char));
           sprintf (fbkpid, "%s/%s.pid", r_inputs->value, usid->value);
+	  setMapInMaps (m, "lenv", "file.pid", fbkpid);
 
           f0 = freopen (fbkpid, "w+",stdout);
@@ -2102,4 +2134,5 @@
                      strlen (usid->value) + 7) * sizeof (char));
           sprintf (fbkp, "%s/%s.sid", r_inputs->value, usid->value);
+	  setMapInMaps (m, "lenv", "file.sid", fbkp);
           FILE* f2 = freopen (fbkp, "w+",stdout);
 	  printf("%s",tmpm->value);
@@ -2113,4 +2146,5 @@
           sprintf (fbkp, "%s/%s_%s.xml", r_inputs->value, r_inputs1->value,
                    usid->value);
+	  setMapInMaps (m, "lenv", "file.responseInit", fbkp);
           flog =
             (char *)
@@ -2119,4 +2153,5 @@
           sprintf (flog, "%s/%s_%s_error.log", r_inputs->value,
                    r_inputs1->value, usid->value);
+	  setMapInMaps (m, "lenv", "file.log", flog);
 #ifdef DEBUG
           fprintf (stderr, "RUN IN BACKGROUND MODE \n");
@@ -2160,4 +2195,5 @@
           sprintf (fbkp1, "%s/%s_final_%s.xml", r_inputs->value,
                    r_inputs1->value, usid->value);
+	  setMapInMaps (m, "lenv", "file.responseFinal", fbkp1);
 
           f1 = freopen (fbkp1, "w+", stdout);
