]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3731] Fix default pidfile location in meson
authorAndrei Pavel <andrei@isc.org>
Thu, 13 Mar 2025 09:49:11 +0000 (11:49 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 13 Mar 2025 17:03:38 +0000 (18:03 +0100)
src/lib/process/Makefile.am
src/lib/process/daemon.cc
src/lib/process/meson.build
src/lib/process/tests/Makefile.am
src/lib/process/tests/daemon_unittest.cc
src/lib/process/tests/meson.build

index 8ed5ec84088dba38c155cfbfb3acd9b8af1c8d52..3ef7fbd000fcf55c99125e6e60a0965602d29990 100644 (file)
@@ -1,8 +1,7 @@
 SUBDIRS = cfgrpt . testutils tests
-# DATA_DIR is the directory where to put PID files.
 dhcp_data_dir = @runstatedir@/@PACKAGE@
 AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -DDATA_DIR="\"$(dhcp_data_dir)\""
+AM_CPPFLAGS += -DPIDFILE_DIR="\"$(dhcp_data_dir)\""
 
 AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CXXFLAGS  = $(KEA_CXXFLAGS)
index 2d5a4e735d7b919ce93ff7979568bb6eaed78383..b6a61e7bc5cdc9d9423adfb29dd5febf06e9a7db 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -40,7 +40,7 @@ std::string Daemon::default_logger_name_("kea");
 
 Daemon::Daemon()
     : signal_set_(), config_file_(""),
-      pid_file_dir_(DATA_DIR), pid_file_(), am_file_author_(false),
+      pid_file_dir_(PIDFILE_DIR), pid_file_(), am_file_author_(false),
       exit_value_(EXIT_SUCCESS) {
 
     // The pid_file_dir can be overridden via environment variable
index e1ce5e1322d29f7fd48e7569b59a049a23a5c40a..1420a6d5bb75a32542c885403378a1c29312621d 100644 (file)
@@ -12,7 +12,7 @@ kea_process_lib = shared_library(
     'log_parser.cc',
     'process_messages.cc',
     'redact_config.cc',
-    cpp_args: [f'-DDATA_DIR="@DHCP_DATA_DIR@"'],
+    cpp_args: [f'-DPIDFILE_DIR="@LOCALSTATEDIR@/run/kea"'],
     dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
index 30e5057b75bf540f557967463b10f8e3587b9af1..672c7193eff64e41185a05373b74de1db77808bf 100644 (file)
@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/process/tests\"
 AM_CPPFLAGS += -DTEST_SCRIPT_SH=\"$(abs_top_builddir)/src/lib/process/tests/process_test.sh\"
-AM_CPPFLAGS += -DDATA_DIR="\"$(dhcp_data_dir)\""
+AM_CPPFLAGS += -DPIDFILE_DIR="\"$(dhcp_data_dir)\""
 AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
 
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
index 3ac29f29839e0ffdc688d82736596cf406da2350..3430e21b4a2b0f97a59e1f03bf2a12e3b1cc3d77 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -89,7 +89,7 @@ TEST_F(DaemonTest, constructor) {
     // Check only instance values.
     Daemon instance2;
     EXPECT_TRUE(instance2.getConfigFile().empty());
-    EXPECT_EQ(std::string(DATA_DIR), instance2.getPIDFileDir());
+    EXPECT_EQ(std::string(PIDFILE_DIR), instance2.getPIDFileDir());
     EXPECT_TRUE(instance2.getPIDFileName().empty());
 }
 
index 4c6aecb7d8415a46ba9bb83b829f8f876a19af7e..40ff589d586bba9b5316d606eab87fb84a68cd7b 100644 (file)
@@ -25,7 +25,7 @@ kea_process_tests = executable(
     cpp_args: [
         f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
         f'-DTEST_SCRIPT_SH="@current_build_dir@/process_test.sh"',
-        f'-DDATA_DIR="@DHCP_DATA_DIR@"',
+        f'-DPIDFILE_DIR="@LOCALSTATEDIR@/run/kea"',
     ],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR,