]> git.ipfire.org Git - thirdparty/kea.git/commit
[3769] Added env var,KEA_PIDFILE_DIR; D2 now uses a PIDFile
authorThomas Markwalder <tmark@isc.org>
Thu, 2 Jul 2015 18:42:58 +0000 (14:42 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 2 Jul 2015 18:42:58 +0000 (14:42 -0400)
commitd743c5f2743e3e07d83a8f8fa5cf8d7dee8379e5
tree1ada0c06898ce55bdc2649ca5380669b7feb0f1e
parente897f24ac63aa47888161c2336aea03d930fad6c
[3769] 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.
13 files changed:
src/bin/d2/d2_messages.mes
src/bin/d2/d_controller.cc
src/bin/d2/d_controller.h
src/bin/d2/tests/Makefile.am
src/bin/d2/tests/d2_process_tests.sh.in
src/bin/d2/tests/d2_unittests.cc
src/bin/keactrl/tests/Makefile.am
src/lib/dhcpsrv/daemon.cc
src/lib/dhcpsrv/daemon.h
src/lib/testutils/dhcp_test_lib.sh.in
src/lib/util/pid_file.cc
src/lib/util/pid_file.h
src/lib/util/tests/pid_file_unittest.cc