summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt13
-rw-r--r--bmcweb.service.in13
-rw-r--r--bmcweb.socket9
3 files changed, 35 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28fbe0f..7cde52e 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}
+)
diff --git a/bmcweb.service.in b/bmcweb.service.in
new file mode 100644
index 0000000..644ecca
--- /dev/null
+++ b/bmcweb.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=Start bmcweb server
+
+Wants=network.target
+After=network.target
+
+[Service]
+ExecStart=@CMAKE_INSTALL_PREFIX@/bin/bmcweb
+Type=simple
+WorkingDirectory=/home/root
+
+[Install]
+WantedBy=network.target
diff --git a/bmcweb.socket b/bmcweb.socket
new file mode 100644
index 0000000..8782e4d
--- /dev/null
+++ b/bmcweb.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=BMC Webserver socket
+
+[Socket]
+ListenStream=443
+ReusePort=true
+
+[Install]
+WantedBy=sockets.target
OpenPOWER on IntegriCloud