Author: jfclere
Date: Mon Aug 15 04:19:48 2005
New Revision: 232794

URL: http://svn.apache.org/viewcvs?rev=232794&view=rev
Log:
Fix 35017 (wait 60 seconds before restarting!).

Modified:
    jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c

Modified: jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c?rev=232794&r1=232793&r2=232794&view=diff
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c 
(original)
+++ jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c Mon 
Aug 15 04:19:48 2005
@@ -31,6 +31,7 @@
 #define _LINUX_FS_H 
 #include <linux/capability.h>
 #endif
+#include <time.h>
 
 extern char **environ;
 
@@ -600,6 +601,7 @@
     pid_t pid=0;
     uid_t uid=0;
     gid_t gid=0;
+    time_t laststart;
 
     /* Parse command line arguments */
     args=arguments(argc,argv);
@@ -685,6 +687,7 @@
     while ((pid=fork())!=-1) {
         /* We forked (again), if this is the child, we go on normally */
         if (pid==0) exit(child(args,data,uid,gid));
+        laststart = time(NULL);
 
         /* We are in the controller, we have to forward all interesting signals
            to the child, and wait for it to die */
@@ -710,6 +713,11 @@
             /* See java_abort123 (we use this return code to restart when the 
JVM aborts) */
             if (status==123) {
                 log_debug("Reloading service");
+                /* prevent looping */
+                if (laststart+60>time(NULL)) {
+                  log_debug("Waiting 60 s to prevent looping");
+                  sleep(60);
+                } 
                 continue;
             }
             /* If the child got out with 0 he is shutting down */



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to