Changeset d35e5750bdb0ea8cb9298ac1b94ccbbf73d88147

Show
Ignore:
Timestamp:
11/23/11 00:27:22 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1322008042 -0500
git-parent:

[39120ca355870745f19446dee86dbae44997dcc3]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1322008042 -0500
Message:

allow for a configurable watchdog timeout

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_main.c

    r559e017 rd35e575  
    117117          const char *drop_to_user, const char *drop_to_group, 
    118118          int (*passed_child_main)(void)) { 
    119   int fd, lockfd
     119  int fd, lockfd, watchdog_timeout = 0
    120120  char conf_str[1024]; 
    121121  char lockfile[PATH_MAX]; 
     
    124124  char appscratch[1024]; 
    125125  char *glider = (char *)_glider; 
     126  char *watchdog_timeout_str; 
    126127    
    127128  /* First initialize logging, so we can log errors */ 
     
    199200  if(foreground) return passed_child_main(); 
    200201 
     202  watchdog_timeout_str = getenv("WATCHDOG_TIMEOUT"); 
     203  if(watchdog_timeout_str) { 
     204    watchdog_timeout = atoi(watchdog_timeout_str); 
     205    noitL(noit_error, "Setting watchdog timeout to %d\n", 
     206          watchdog_timeout); 
     207  } 
     208 
    201209  /* This isn't inherited across forks... */ 
    202210  if(lockfd >= 0) noit_lockfile_release(lockfd); 
     
    219227 
    220228  signal(SIGHUP, SIG_IGN); 
    221   return noit_watchdog_start_child("noitd", passed_child_main, 0); 
    222 } 
     229  return noit_watchdog_start_child("noitd", passed_child_main, watchdog_timeout); 
     230}