Index: /trunk/zoo-kernel/service.h
===================================================================
--- /trunk/zoo-kernel/service.h	(revision 253)
+++ /trunk/zoo-kernel/service.h	(revision 254)
@@ -124,4 +124,5 @@
     map* tmp=t;
     while(tmp!=NULL){
+      fprintf(stderr,"%s = %s\n",tmp->name,tmp->value);
       fprintf(file,"%s = %s\n",tmp->name,tmp->value);
       tmp=tmp->next;
@@ -138,10 +139,13 @@
   }
 
-  static void dumpMapsToFile(maps* m,FILE* file){
+  static void dumpMapsToFile(maps* m,char* file_path){
+    FILE* file=fopen(file_path,"w");
     maps* tmp=m;
     if(tmp!=NULL){
       fprintf(file,"[%s]\n",tmp->name);
       dumpMapToFile(tmp->content,file);
-    }
+      fflush(file);
+    }
+    fclose(file);
   }
 
Index: /trunk/zoo-kernel/service_internal.c
===================================================================
--- /trunk/zoo-kernel/service_internal.c	(revision 253)
+++ /trunk/zoo-kernel/service_internal.c	(revision 254)
@@ -1722,7 +1722,5 @@
       else
 	sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(_tmp->value,"=")+1);
-      FILE* file=fopen(session_file_path,"w");
-      dumpMapsToFile(tmpSess,file);
-      fclose(file);
+      dumpMapsToFile(tmpSess,session_file_path);
     }
   }
Index: /trunk/zoo-kernel/zoo_service_loader.c
===================================================================
--- /trunk/zoo-kernel/zoo_service_loader.c	(revision 253)
+++ /trunk/zoo-kernel/zoo_service_loader.c	(revision 254)
@@ -1821,5 +1821,5 @@
     struct stat file_status;
     int istat = stat(session_file_path, &file_status);
-    if(istat==0){
+    if(istat==0 && file_status.st_size>0){
       conf_read(session_file_path,tmpSess);
       dumpMaps(tmpSess);
