diff --git a/CMakeLists.txt b/CMakeLists.txt index 5da4f54..c2702ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,4 +80,5 @@ include_directories(${PROJECT_BINARY_DIR}) install(TARGETS ibarr DESTINATION bin) -install(FILES ibarr.service DESTINATION /lib/systemd/system) +configure_file(ibarr.service.in ibarr.service) +install(FILES ${CMAKE_BINARY_DIR}/ibarr.service DESTINATION lib/systemd/system) diff --git a/ibarr.service b/ibarr.service.in similarity index 88% rename from ibarr.service rename to ibarr.service.in index dd812e2..5060ed1 100644 --- a/ibarr.service +++ b/ibarr.service.in @@ -3,7 +3,7 @@ Description=Nvidia address and route userspace resolution services for Infiniban Documentation=https://github.com/Melanox/ip2gid/ [Service] -ExecStart=/usr/bin/ibarr +ExecStart=@CMAKE_INSTALL_PREFIX@/bin/ibarr # Try to restrict it, because it hardly reads and writes files: PrivateTmp=yes ProtectHome=yes