diff options
Diffstat (limited to 'systemd')
-rw-r--r-- | systemd/CMakeLists.txt | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt index 499b5d19024..ad75ce61cd8 100644 --- a/systemd/CMakeLists.txt +++ b/systemd/CMakeLists.txt @@ -1,5 +1,14 @@ -set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_LIBEXECDIR}/systemd/system" - CACHE PATH "Location for systemd service files") +find_package(PkgConfig QUIET REQUIRED) +pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR "systemd" "systemd_system_unit_dir") +if(NOT SYSTEMD_SYSTEM_UNIT_DIR) + pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR "systemd" "systemdsystemunitdir") + if(NOT SYSTEMD_SYSTEM_UNIT_DIR) + set(SYSTEMD_SYSTEM_UNIT_DIR "${CMAKE_INSTALL_LIBDIR}/systemd/system") + endif() +endif() +set(SYSTEMD_SYSTEM_UNIT_DIR "${SYSTEMD_SYSTEM_UNIT_DIR}" + CACHE PATH "Location for systemd system unit files") + set(CEPH_SYSTEMD_ENV_DIR "/etc/sysconfig" CACHE PATH "Location for systemd service environmental variable settings files") set(SYSTEMD_ENV_FILE "${CEPH_SYSTEMD_ENV_DIR}/ceph") @@ -21,7 +30,7 @@ foreach(service @ONLY) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${service}.service - DESTINATION ${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}) + DESTINATION ${SYSTEMD_SYSTEM_UNIT_DIR}) endforeach() install(FILES @@ -36,4 +45,4 @@ install(FILES ceph-immutable-object-cache.target ceph-volume@.service cephfs-mirror.target - DESTINATION ${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}) + DESTINATION ${SYSTEMD_SYSTEM_UNIT_DIR}) |