summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-09-05 16:53:31 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-09-05 16:53:31 +0200
commit7546e75b7c3b8ed0b5cfa11c9b9b45831ab34a53 (patch)
treee4b9cc08e60d42120ce997926aa03df2876d0855
parent3ed56c914851fa6eab5744213fd2e700f1ab71a8 (diff)
downloadouroboros-7546e75b7c3b8ed0b5cfa11c9b9b45831ab34a53.tar.gz
ouroboros-7546e75b7c3b8ed0b5cfa11c9b9b45831ab34a53.zip
build: Add systemd unit on install
This adds a systemd unit for the irmd on installation of Ouroboros.
-rw-r--r--CMakeLists.txt8
-rw-r--r--irmd.service.in9
-rw-r--r--src/lib/CMakeLists.txt2
3 files changed, 18 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4060d5f..db583144 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,6 +74,14 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros.pc.in"
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.pc"
DESTINATION "usr/lib/pkgconfig")
+if (IS_DIRECTORY "/usr/lib/systemd")
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/irmd.service.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/irmd.service" @ONLY)
+
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/irmd.service"
+ DESTINATION "usr/lib/systemd/system")
+endif ()
+
enable_testing()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
diff --git a/irmd.service.in b/irmd.service.in
new file mode 100644
index 00000000..e6dc006e
--- /dev/null
+++ b/irmd.service.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Ouroboros IPC Resource Manager Daemon
+
+[Service]
+ExecStart=@CMAKE_INSTALL_PREFIX@/sbin/irmd
+User=root
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 9d8fbf9c..eeb7966b 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -52,7 +52,7 @@ if (LIBGCRYPT_LIBRARIES)
REGEX "^#define GCRYPT_VERSION ")
string(REGEX REPLACE "^#define GCRYPT_VERSION \"(.*)\".*$" "\\1"
GCVER "${GCSTR}")
- message(STATUS "Found libgcrypt: ${LIBGCRYPT_LIBRARIES}"
+ message(STATUS "Found libgcrypt: ${LIBGCRYPT_LIBRARIES} "
"(found version \"${GCVER}\")")
if (NOT GCVER VERSION_LESS "1.7.0")
set (DISABLE_LIBGCRYPT FALSE CACHE BOOL "Disable libgcrypt support")