From f645797aeced86ce78d2ad7d0c9cf869e1200b3a Mon Sep 17 00:00:00 2001 From: "Christoph J. Thompson" Date: Sat, 13 Dec 2014 23:09:53 +0100 Subject: [PATCH 4/5] * Conditionally install systemd support files modified: CMakeLists.txt new file: doc/uhub.service new file: doc/uhub.tmpfiles --- CMakeLists.txt | 7 +++++++ doc/uhub.service | 16 ++++++++++++++++ doc/uhub.tmpfiles | 1 + 3 files changed, 24 insertions(+) create mode 100644 doc/uhub.service create mode 100644 doc/uhub.tmpfiles diff --git a/CMakeLists.txt b/CMakeLists.txt index c879185..d08310e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,5 +251,12 @@ if (UNIX) install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.conf ${CMAKE_SOURCE_DIR}/plugins.conf ${CMAKE_SOURCE_DIR}/doc/rules.txt ${CMAKE_SOURCE_DIR}/doc/motd.txt DESTINATION /etc/uhub/ OPTIONAL ) install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.1 ${CMAKE_SOURCE_DIR}/doc/uhub-passwd.1 DESTINATION ${INSTALL_MAN_DIR}/man1/ OPTIONAL ) install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.logrotate DESTINATION /etc/logrotate.d/ RENAME uhub OPTIONAL ) + + if(SYSTEMD_SUPPORT) + install ( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.service DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/system/ OPTIONAL ) + install ( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.tmpfiles DESTINATION +${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d/ RENAME uhub.conf OPTIONAL ) + endif() + endif() diff --git a/doc/uhub.service b/doc/uhub.service new file mode 100644 index 0000000..24d922d --- /dev/null +++ b/doc/uhub.service @@ -0,0 +1,16 @@ +[Unit] +Description=uHub ADC hub Server +Documentation=man:uhub(1) +After=network.target + +[Service] +Type=simple +User=uhub +ExecStart=/usr/bin/uhub -p /run/uhub/uhub.pid +ExecReload=/usr/bin/uhub -C ; \ + /bin/kill -HUP $MAINPID +StandardError=journal + +[Install] +WantedBy=multi-user.target + diff --git a/doc/uhub.tmpfiles b/doc/uhub.tmpfiles new file mode 100644 index 0000000..c548637 --- /dev/null +++ b/doc/uhub.tmpfiles @@ -0,0 +1 @@ +d /run/uhub 0755 uhub uhub -- 2.1.3