COVESA / COVESA/dlt-daemon

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

Open
#848 4 comments 0 reactions 1 assignee Claimed by @minminlittleshrimp View on GitHub
bug techdebt
Dominant language
C
Stars
459
Forks
340
Avg merge
4d 21h
Merged PRs (30d)
2

Description

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] https://github.com/COVESA/dlt-daemon/commit/723e90e77db91130375238a592b9a292302a32bb

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".

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.