summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2019-04-11 02:33:15 +0300
committerEd Tanous <ed.tanous@intel.com>2019-04-22 20:37:41 +0300
commit5a7094b22c9bc07ea7bfd591990fd8c9f2ac6419 (patch)
tree7b1c0387b3598ce9575b94a93d66c16b319782c6 /CMakeLists.txt
parent4418c7f0ddcc5d3518831729a380a0b67e5d4093 (diff)
downloadbmcweb-5a7094b22c9bc07ea7bfd591990fd8c9f2ac6419.tar.xz
Add systemd unit files
Add bmcweb.socket, a systemd unit file that enables systemd socket activation of bmcweb. Systemd socket activation defers startup of socket listening applications until something connects to the socket. There are presently no configurable parameters in bmcweb.socket. Add bmcweb.service, a systemd unit file for starting bmcweb. bmcweb.service has one configurable parameter, the installation prefix. Prior these unit files were hosted in the meta-phosphor repository but OpenBMC is moving away from unit-files-in-metadata and trying to do it the way the rest of the world does it - unit files are provided by the projects that contain the application source. The unit files were copied mostly verbatim (minor update for installation prefix in bmcweb.service template) so the only new logic here is in the cmake logic. Tested by: 1 - devtool add bmcweb. 2 - apply this diff to bmcweb_git.bb: -inherit obmc-phosphor-systemd +inherit systemd 3 - bitbake bmcweb. 4 - manual inspection of the image dir in the yocto build tree. Change-Id: I61b49d519f5b4eb06e97a14d4f6707344e544434 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28fbe0ff60..7cde52ec1a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -273,3 +273,16 @@ target_compile_definitions (
$<$<BOOL:${BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES}>: -DBMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES>
)
+
+# configure and install systemd unit files
+configure_file (bmcweb.socket bmcweb.socket COPYONLY)
+configure_file (bmcweb.service.in bmcweb.service)
+pkg_get_variable (SYSTEMD_SYSTEMUNITDIR systemd systemdsystemunitdir)
+install (
+ FILES ${PROJECT_BINARY_DIR}/bmcweb.socket
+ DESTINATION ${SYSTEMD_SYSTEMUNITDIR}
+)
+install (
+ FILES ${PROJECT_BINARY_DIR}/bmcweb.service
+ DESTINATION ${SYSTEMD_SYSTEMUNITDIR}
+)