2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 09:57:41 +00:00

[#3731] Fix default pidfile location in meson

This commit is contained in:
Andrei Pavel 2025-03-13 11:49:11 +02:00 committed by Francis Dupont
parent 9dc78e849b
commit f32d1b1dd5
6 changed files with 8 additions and 9 deletions

View 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)

View 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

View 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,

View 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)

View 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());
}

View 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,