mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-30 09:04:35 +02:00
Implement an environment variable to keep Icinga from closing FDs on startup
fixes #12510
This commit is contained in:
parent
218e780a44
commit
53f5a603ce
@ -706,6 +706,7 @@ VOID WINAPI ServiceMain(DWORD argc, LPSTR *argv)
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
if (!getenv("ICINGA2_KEEP_FDS")) {
|
||||||
rlimit rl;
|
rlimit rl;
|
||||||
if (getrlimit(RLIMIT_NOFILE, &rl) >= 0) {
|
if (getrlimit(RLIMIT_NOFILE, &rl) >= 0) {
|
||||||
rlim_t maxfds = rl.rlim_max;
|
rlim_t maxfds = rl.rlim_max;
|
||||||
@ -722,6 +723,7 @@ int main(int argc, char **argv)
|
|||||||
#endif /* I2_DEBUG */
|
#endif /* I2_DEBUG */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
/* must be called before using any other libbase functions */
|
/* must be called before using any other libbase functions */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user