Index: branches/prototype-v0/zoo-project/zoo-services/hello-mono/cgi-env/longProcessMono.zcfg
===================================================================
--- branches/prototype-v0/zoo-project/zoo-services/hello-mono/cgi-env/longProcessMono.zcfg	(revision 906)
+++ branches/prototype-v0/zoo-project/zoo-services/hello-mono/cgi-env/longProcessMono.zcfg	(revision 907)
@@ -1,5 +1,5 @@
 [longProcessMono]
- Title = Create a welcome message string.
- Abstract = Create a welcome string.
+ Title = Demo long process.
+ Abstract = This service doesn't do anything except taking its time, it demonstrates how to use the updateStatus function from your ZOO Service.
  processVersion = 2
  storeSupported = true
@@ -13,22 +13,9 @@
    Title = Input string
    Abstract = The name to display in the welcome message.
-   minOccurs = 1
+   minOccurs = 0
    maxOccurs = 1
    <LiteralData>
     dataType = int
-    <Default>
-    AllowedValues = 101,202,303,404
-    rangeMin = -100
-    rangeMax = 100
-    rangeSpacing = 1
-    rangeClosure = co
-      value = 11
-    </Default>
-    <Supported>
-    	AllowedValues = 405,502,503,504
-    </Supported>
-    <Supported>
-    	AllowedValues = 540,502,603,604
-    </Supported>
+    <Default />
    </LiteralData>
  </DataInputs>
Index: branches/prototype-v0/zoo-project/zoo-services/hello-mono/makefile.vc
===================================================================
--- branches/prototype-v0/zoo-project/zoo-services/hello-mono/makefile.vc	(revision 907)
+++ branches/prototype-v0/zoo-project/zoo-services/hello-mono/makefile.vc	(revision 907)
@@ -0,0 +1,9 @@
+!INCLUDE ../../zoo-kernel/nmake.opt
+	
+all: cgi-env/TestService.dll
+
+cgi-env/TestService.dll: test.cs
+	$(MONO_DIR)\bin\mcs /target:library -r:../../zoo-api/mono/ZMaps.dll -out:cgi-env/TestService.dll test.cs
+
+clean:
+	rm -rf cgi-env/*dll
Index: branches/prototype-v0/zoo-project/zoo-services/utils/hpc/Makefile
===================================================================
--- branches/prototype-v0/zoo-project/zoo-services/utils/hpc/Makefile	(revision 906)
+++ branches/prototype-v0/zoo-project/zoo-services/utils/hpc/Makefile	(revision 907)
@@ -3,5 +3,5 @@
 CFLAGS=-I${INST_INCLUDE} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG
 
-cgi-env/wps_hpc.zo: service.c
+cgi-env/wps_hpc.zo: service.c service2.c
 	g++ ${CFLAGS} -shared -fpic -o cgi-env/wps_hpc.zo service.c service2.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} ${FCGI_LDFLAGS} -L${ZRPATH}/zoo-kernel/ -lzoo_service ${ZRPATH}/zoo-kernel/sshapi.o ${HPCLDFLAGS}
 
Index: branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service.c	(revision 906)
+++ branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service.c	(revision 907)
@@ -269,5 +269,5 @@
     }
     free(logPath);
-    // Run scontrol to check if the service execution ended.
+    // Run sacct to check if the service execution ended.
     // Store all the informations returned by scontrol command as a cfg file to
     // be parsed back by the ZOO-Kernel waiting for the execution of the remote
@@ -277,8 +277,8 @@
     map* tmpMap=getMapFromMaps(conf,configId->value,"remote_command_opt");
     char* command=(char*)malloc((126+strlen(tmpMap->value))*sizeof(char));
-    sprintf(command,"sacct --format=%s -p | grep \"%s\" | sed \"s:||:|None|:g;s:||:|:g\"",tmpMap->value,jobid->value);    
+    sprintf(command,"sacct --format=%s -p | grep \"%s\" | sed \"s:||:|None|:g;s:||:|None|:g\"",tmpMap->value,jobid->value);    
     if(ssh_exec(conf,command,ssh_get_cnt(conf))==0){
       free(command);
-      setMapInMaps(conf,"lenv","message",_("Failed to run scontrol remotely"));
+      setMapInMaps(conf,"lenv","message",_("Failed to run sacct remotely"));
       // TODO: check status in db and if available continue in other case return SERVICE_FAILED
       return SERVICE_FAILED;
@@ -315,7 +315,15 @@
 	}
       }else{
+	free(logPath);
 	setMapInMaps(conf,"lenv","message",_("Unable to access the downloaded execution log file"));
 	return SERVICE_FAILED;
       }
+    }
+    tmpMap=getMapFromMaps(tmpMaps,"henv","JobId");
+    if(tmpMap!=NULL){
+      char* tmpStr=(char*)malloc((32)*sizeof(char));
+      sprintf(tmpStr,"slurm-%s.out",tmpMap->value);
+      addToMap(tmpMaps->content,"StdErr",tmpStr); 
+      free(tmpStr);
     }
     logPath=(char*)malloc((strlen(tmpPath->value)+strlen(jobid->value)+15)*sizeof(char));
Index: branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service2.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service2.c	(revision 906)
+++ branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service2.c	(revision 907)
@@ -133,5 +133,5 @@
     if(unlink(fullpath)==0){
       // TODO store the filename_full in the deletedfiles
-      fprintf(stderr,"#### DeleteData #### %s %d %s has been successfully deleted\n",__FILE__,__LINE__,(strlen(filename)>0?filename:fullpath));
+      fprintf(stderr,"#### DeleteData #### %s %d %s has been successfully deleted\n",__FILE__,__LINE__,(filename!=NULL && strlen(filename)>0?filename:fullpath));
     }else{
       fprintf(stderr,"#### DeleteData #### unable to delete %s %s \n",fullpath,fetchErrno(errno));
@@ -155,5 +155,5 @@
     map* ioname=getMapFromMaps(inputs,"ioname","value");
     char tmp0[4];
-    sprintf(tmp0,"%c%c%c",filename->value[strlen(filename->value)-4],filename->value[strlen(filename->value)-3],filename->value[strlen(filename->value)-2]);
+    sprintf(tmp0,"%c%c%c",filename->value[strlen(filename->value)-3],filename->value[strlen(filename->value)-2],filename->value[strlen(filename->value)-1]);
     char *cfilename=NULL;
     if(strcasecmp(tmp0,"zca")==0){
@@ -208,6 +208,6 @@
 	char tmp1[8];
 	snprintf(tmp1,7,"%s",filename->value);
-	if(strcasecmp(tmp1,"output")==0 || strcasecmp(tmp1,"input_")==0){
-	  trydeletedatafile(tmppath->value,filename->value);
+	if(strcasecmp(tmp1,"output")==0 || strstr(filename->value,".zca")!=NULL || strcasecmp(tmp1,"input_")==0){
+	  tryDeleteDataFile(tmpPath->value,filename->value);
           char *tmp=zStrdup(filename->value);
 	  tmp[strlen(tmp)-strlen(strrchr(tmp,'.'))]=0;
@@ -254,5 +254,5 @@
 	  setMapInMaps(outputs,"Result","value",_ss("The output data has been correclty removed"));
 	}else{
-	  setMapInMaps(conf,"lenv","message",_ss("The file you try to delete is nor an input, nor and output."));
+	  setMapInMaps(conf,"lenv","message",_ss("The file you try to delete is nor an input, nor an output."));
 	  unlockFile(conf,lck);
 	  return SERVICE_FAILED;
Index: branches/prototype-v0/zoo-project/zoo-services/utils/status/service.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-services/utils/status/service.c	(revision 906)
+++ branches/prototype-v0/zoo-project/zoo-services/utils/status/service.c	(revision 907)
@@ -72,4 +72,7 @@
       return SERVICE_FAILED;
     }
+    map tmpMap1=getMapFromMaps(conf,"lenv","semaphore")
+    if(tmpMap1!=NULL && strcasecmp(tmpMap1->value,"Created")==0)
+      removeShmLock(conf,1);
     sprintf(xslFileName,"%s/updateStatus.xsl",tmpMmap->value);
     xmlSubstituteEntitiesDefault(1);
