Make sure that the /var/log/icinga2/crash directory exists

fixes #8683
This commit is contained in:
Michael Friedrich 2015-03-11 16:06:04 +01:00
parent cc698d1ae2
commit 9db3d42135
1 changed files with 6 additions and 0 deletions

View File

@ -624,6 +624,8 @@ void Application::SigAbrtHandler(int)
<< std::endl; << std::endl;
String fname = GetCrashReportFilename(); String fname = GetCrashReportFilename();
Utility::MkDir(Utility::DirName(fname), 0750);
std::ofstream ofs; std::ofstream ofs;
ofs.open(fname.CStr()); ofs.open(fname.CStr());
@ -682,6 +684,8 @@ void Application::ExceptionHandler(void)
#endif /* _WIN32 */ #endif /* _WIN32 */
String fname = GetCrashReportFilename(); String fname = GetCrashReportFilename();
Utility::MkDir(Utility::DirName(fname), 0750);
std::ofstream ofs; std::ofstream ofs;
ofs.open(fname.CStr()); ofs.open(fname.CStr());
@ -724,6 +728,8 @@ LONG CALLBACK Application::SEHUnhandledExceptionFilter(PEXCEPTION_POINTERS exi)
l_InExceptionHandler = true; l_InExceptionHandler = true;
String fname = GetCrashReportFilename(); String fname = GetCrashReportFilename();
Utility::MkDir(Utility::DirName(fname), 0750);
std::ofstream ofs; std::ofstream ofs;
ofs.open(fname.CStr()); ofs.open(fname.CStr());