Changeset d35e5750bdb0ea8cb9298ac1b94ccbbf73d88147
- Timestamp:
- 11/23/11 00:27:22
(2 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
| r559e017 |
rd35e575 |
|
| 117 | 117 | const char *drop_to_user, const char *drop_to_group, |
|---|
| 118 | 118 | int (*passed_child_main)(void)) { |
|---|
| 119 | | int fd, lockfd; |
|---|
| | 119 | int fd, lockfd, watchdog_timeout = 0; |
|---|
| 120 | 120 | char conf_str[1024]; |
|---|
| 121 | 121 | char lockfile[PATH_MAX]; |
|---|
| … | … | |
| 124 | 124 | char appscratch[1024]; |
|---|
| 125 | 125 | char *glider = (char *)_glider; |
|---|
| | 126 | char *watchdog_timeout_str; |
|---|
| 126 | 127 | |
|---|
| 127 | 128 | /* First initialize logging, so we can log errors */ |
|---|
| … | … | |
| 199 | 200 | if(foreground) return passed_child_main(); |
|---|
| 200 | 201 | |
|---|
| | 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 | |
|---|
| 201 | 209 | /* This isn't inherited across forks... */ |
|---|
| 202 | 210 | if(lockfd >= 0) noit_lockfile_release(lockfd); |
|---|
| … | … | |
| 219 | 227 | |
|---|
| 220 | 228 | 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 | } |
|---|