Re: Strange daemontools problem on AIX

[email protected] (Paul Jarc)
Newsgroups gmane.comp.djb.syslog
Organization What did you have in mind? A short, blunt, human pyramid?
Message-ID <[email protected]>
Jurjen Oskam <[email protected]> wrote:
> Something has gone wrong here. supervise doesn't seem to actually try again
> after failing the fork and waiting 60 seconds.

It looks like a bug to me.  supervise only tries to restart the
service immediately after reaping the child process, or after "svc -o"
or "svc -u".  (You don't need to run "svc -d" first.)  This patch
should fix it.  If you're able to bring your system into the
low-memory state deliberately, I'd be interested in knowing whether
this helps supervise recover.


paul
daemontools-0.76-restart.patch (text/x-patch, 657 B)
diff -ur admin/daemontools-0.76-orig/src/supervise.c admin/daemontools-0.76/src/supervise.c
--- admin/daemontools-0.76-orig/src/supervise.c	2001-07-12 12:49:27.000000000 -0400
+++ admin/daemontools-0.76/src/supervise.c	2005-12-27 16:15:41.000000000 -0500
@@ -148,7 +148,6 @@
 	pidchange();
 	announce();
 	if (flagexit) return;
-	if (flagwant && flagwantup) trystart();
 	break;
       }
     }
@@ -165,7 +164,6 @@
 	  flagwant = 1;
 	  flagwantup = 1;
 	  announce();
-	  if (!pid) trystart();
 	  break;
 	case 'o':
 	  flagwant = 0;
@@ -202,6 +200,8 @@
 	  announce();
 	  break;
       }
+
+    if (!pid && flagwant && flagwantup) trystart();
   }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.