Added env var,KEA_PIDFILE_DIR; D2 now uses a PIDFile
src/lib/dhcpsrv/daemon.c/h Daemon::Daemon() - Constructor will now override the default PID directory with the value of env variable KEA_PIDFILE_DIR. This provides a simple means to alter the value for tests. Added am_file_author_ flag so Daemon instances will only delete a file they have written. src/lib/testutils/dhcp_test_lib.sh.in - verify_server_pid() - new function which verifies that a server has a PID file and that it contains the server's PID, and that the process is alive. src/bin/keactrl/tests/Makefile.am - added export of KEA_PIDFILE_DIR to override default PID directory during tests Added PID file creation to D2 src/bin/d2/d_controller.cc - DControllerBase::launch() - Added block to createPIDFile() -DControllerBase::parseArgs() Replaced call to Daemon::init() with call to Daemon::setConfigFile() src/bin/d2/tests/Makefile.am - added export of KEA_PIDFILE_DIR to override default PID directory during tests src/bin/d2/tests/d2_process_tests.sh.in - dupcliate_server_start_test() - new test which verifies that D2 cannot be started twice (with the same configuration file) src/bin/d2/tests/d2_unittests.cc - main(int argc, char* argv) sets environment variable KEA_PIDFILE_DIR to override default PID diretory during tests src/lib/util/pid_file.cc/h src/lib/util/tests/pid_file_unittest.cc Changed PIDFile::check() to return either the PID contained in the PID file if the process is alive, or 0, rather than bool. This permits callers to see/log the PID.
Showing with 166 additions and 15 deletions