Fix issue #2 - ndppd dæmonizes too early
This commit is contained in:
parent
24aeceb060
commit
00da8bf7ba
18
src/ndppd.cc
18
src/ndppd.cc
@ -201,15 +201,6 @@ int main(int argc, char* argv[], char* env[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (daemon) {
|
|
||||||
logger::syslog(true);
|
|
||||||
|
|
||||||
if (daemonize() < 0) {
|
|
||||||
logger::error() << "Failed to daemonize process";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pidfile.empty()) {
|
if (!pidfile.empty()) {
|
||||||
std::ofstream pf;
|
std::ofstream pf;
|
||||||
pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc);
|
pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc);
|
||||||
@ -225,8 +216,15 @@ int main(int argc, char* argv[], char* env[])
|
|||||||
|
|
||||||
if (!configure(config_path))
|
if (!configure(config_path))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (daemon) {
|
||||||
|
logger::syslog(true);
|
||||||
|
|
||||||
//route::load("/proc/net/ipv6_route");
|
if (daemonize() < 0) {
|
||||||
|
logger::error() << "Failed to daemonize process";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Time stuff.
|
// Time stuff.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user