Skip to content

dlt-system.service/dlt.service not works well when usrmerge feature is enabled in linux #848

@sandy-lcq

Description

@sandy-lcq

Commit [723e90e dlt: Adaptation for QNX build system with SDP 7.x (#609)], refer [1], make CONFIGURATION_FILES_DIR not aligned. the CMake variable CONFIGURATION_FILES_DIR set to CMAKE_INSTALL_SYSCONFDIR, but tell the compiler to define macro CONFIGURATION_FILES_DIR as ${CMAKE_INSTALL_PREFIX}/${CONFIGURATION_FILES_DIR}.

At least for linux, this will cause failure of the systemd service. when usrmerge feaure is enabled for linux, CMAKE_INSTALL_PREFIX is /usr, then the configuration file is installed under ${CONFIGURATION_FILES_DIR}, usually it is /etc. But the application like dlt-daemon/dlt-system will find the default configuration file under /usr/etc, since macro CONFIGURATION_FILES_DIR defined to be /usr/etc.
This makes service start failed.

[1] 723e90e

For linux, I think we can change like this, because we don't want to put config under /usr/etc, we just put it under /etc.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4be5192..c943cb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -288,8 +288,7 @@ if(WITH_DLT_CXX11_EXT AND WITH_DLT_PKGCONFIG)
endif()

set(CONFIGURATION_FILES_DIR ${CMAKE_INSTALL_SYSCONFDIR})

-add_definitions(-DCONFIGURATION_FILES_DIR="${CMAKE_INSTALL_PREFIX}/${CONFIGURATION_FILES_DIR}")
+add_definitions(-DCONFIGURATION_FILES_DIR="${CONFIGURATION_FILES_DIR}")

But this is clearly not in line with the intent of the commit 723e90e; hopefully, this can be checked by author "Marcin Sochacki".

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions