Create working_dir after setuid/setgid
This commit is contained in:
parent
97e1f91a16
commit
161b220ee1
1 changed files with 9 additions and 7 deletions
|
@ -188,13 +188,6 @@ int main(int argc, char **argv)
|
|||
#ifndef WIN32
|
||||
if (!no_daemon) {
|
||||
// create directories
|
||||
try {
|
||||
boost::filesystem::create_directories(CONFIG_STRING(&config, "service.working_dir"));
|
||||
}
|
||||
catch (...) {
|
||||
std::cerr << "Can't create service.working_dir directory " << CONFIG_STRING(&config, "service.working_dir") << ".\n";
|
||||
return 1;
|
||||
}
|
||||
try {
|
||||
boost::filesystem::create_directories(
|
||||
boost::filesystem::path(CONFIG_STRING(&config, "service.pidfile")).parent_path().string()
|
||||
|
@ -274,6 +267,15 @@ int main(int argc, char **argv)
|
|||
limit.rlim_max = RLIM_INFINITY;
|
||||
limit.rlim_cur = RLIM_INFINITY;
|
||||
setrlimit(RLIMIT_CORE, &limit);
|
||||
|
||||
// create directories
|
||||
try {
|
||||
boost::filesystem::create_directories(CONFIG_STRING(&config, "service.working_dir"));
|
||||
}
|
||||
catch (...) {
|
||||
std::cerr << "Can't create service.working_dir directory " << CONFIG_STRING(&config, "service.working_dir") << ".\n";
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
Swift::SimpleEventLoop eventLoop;
|
||||
|
|
Loading…
Add table
Reference in a new issue