aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2018-01-04 11:31:45 -0800
committerMartin Braun <martin.braun@ettus.com>2018-01-04 15:01:41 -0800
commit46fd41725308e8abcfed4420162eb1cdf83923a3 (patch)
tree390860412663f1b868a0ca9ddb18674a158bf974
parent83dd47dc882421f96830fa55bd86405d1d80907f (diff)
downloaduhd-46fd41725308e8abcfed4420162eb1cdf83923a3.tar.gz
uhd-46fd41725308e8abcfed4420162eb1cdf83923a3.tar.bz2
uhd-46fd41725308e8abcfed4420162eb1cdf83923a3.zip
mpm: systemd: Add a systemd service file for MPM
Add a service file to start MPM on bootup via systemd. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
-rw-r--r--mpm/CMakeLists.txt1
-rw-r--r--mpm/systemd/CMakeLists.txt21
-rw-r--r--mpm/systemd/usrp-hwd.service.in8
3 files changed, 30 insertions, 0 deletions
diff --git a/mpm/CMakeLists.txt b/mpm/CMakeLists.txt
index 7036f25b5..1dbb57e04 100644
--- a/mpm/CMakeLists.txt
+++ b/mpm/CMakeLists.txt
@@ -159,3 +159,4 @@ SET_TARGET_PROPERTIES(usrp-periphs PROPERTIES SOVERSION ${USRP_PERIPHS_MAJOR})
ADD_SUBDIRECTORY(python)
ADD_SUBDIRECTORY(tools)
+ADD_SUBDIRECTORY(systemd)
diff --git a/mpm/systemd/CMakeLists.txt b/mpm/systemd/CMakeLists.txt
new file mode 100644
index 000000000..bd8dded91
--- /dev/null
+++ b/mpm/systemd/CMakeLists.txt
@@ -0,0 +1,21 @@
+#
+# Copyright 2018 Ettus Research, National Instruments Company
+#
+# SPDX-License-Identifier: GPL-3.0
+#
+
+INCLUDE(FindPkgConfig)
+PKG_CHECK_MODULES(SYSTEMD "systemd" REQUIRED)
+
+PKG_GET_VARIABLE(SYSTEMD_SYSTEM_UNITDIR systemd systemdsystemunitdir)
+MESSAGE(STATUS "Systemd system unit directory ${SYSTEMD_SYSTEM_UNITDIR}")
+
+CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/usrp-hwd.service.in
+ ${CMAKE_CURRENT_BINARY_DIR}/usrp-hwd.service
+)
+
+INSTALL(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/usrp-hwd.service
+ DESTINATION ${SYSTEMD_SYSTEM_UNITDIR}
+)
diff --git a/mpm/systemd/usrp-hwd.service.in b/mpm/systemd/usrp-hwd.service.in
new file mode 100644
index 000000000..91ba942a2
--- /dev/null
+++ b/mpm/systemd/usrp-hwd.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=USRP Hardware Daemon (MPM)
+
+[Service]
+ExecStart=@CMAKE_INSTALL_PREFIX@/bin/usrp_hwd.py
+
+[Install]
+WantedBy=multi-user.target