diff --git a/src/ndppd.cc b/src/ndppd.cc index 20ced6f..66d37b9 100644 --- a/src/ndppd.cc +++ b/src/ndppd.cc @@ -201,13 +201,6 @@ int main(int argc, char* argv[], char* env[]) } } - if (!pidfile.empty()) { - std::ofstream pf; - pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc); - pf << getpid() << std::endl; - pf.close(); - } - logger::notice() << "ndppd (NDP Proxy Daemon) version " NDPPD_VERSION << logger::endl << "Using configuration file '" << config_path << "'"; @@ -226,6 +219,13 @@ int main(int argc, char* argv[], char* env[]) } } + if (!pidfile.empty()) { + std::ofstream pf; + pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc); + pf << getpid() << std::endl; + pf.close(); + } + // Time stuff. struct timeval t1, t2;