Source: daemontools Severity: normal Dear Maintainer,
I would like to report bug in daemontools. Supervise process in daemontools does not correctly hande the situation when the monitored process (e.g. dnscache) died and supervise is trying to fork new process and fork() fails. Supervise then only logs: supervise: warning: unable to fork for dnscache, sleeping 60 seconds: out of memory Here is the patch (6 years tested) which fixes the problem: diff -Nur admin.orig/daemontools-0.76/src/supervise.c admin/daemontools-0.76/src/supervise.c --- admin.orig/daemontools-0.76/src/supervise.c 2010-02-19 11:08:15.000000000 +0100 +++ admin/daemontools-0.76/src/supervise.c 2010-02-19 12:53:16.000000000 +0100 @@ -86,6 +86,8 @@ const char *run[2] = { "./run", 0 }; +int flagfailed = 0; + void trystart(void) { int f; @@ -94,6 +96,7 @@ case -1: strerr_warn4(WARNING,"unable to fork for ",dir,", sleeping 60 seconds: ",&strerr_sys); deepsleep(60); + flagfailed = 1; trigger(); return; case 0: @@ -153,6 +156,11 @@ } } + if (flagfailed && flagwant && flagwantup){ + flagfailed = 0; + trystart(); + } + if (read(fdcontrol,&ch,1) == 1) switch(ch) { case 'd': -- System Information: Debian Release: 8.3 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system)