Add systemd service for OpenPOWER Dump Monitor
This commit introduces a new systemd service for the OpenPOWER Dump
Monitor. The service is responsible for monitoring and handling dump
collection on OpenPOWER systems.
Key changes:
- Added `openpower-dump-monitor.service` to manage the OpenPOWER Dump
Monitor process.
- Updated the meson build system to install the new service file and
create necessary symlinks.
Change-Id: Ie4495631c4dbf399e4acbe7bfd47c7b11bc43fc3
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/dump/dist/meson.build b/dump/dist/meson.build
new file mode 100644
index 0000000..333c28e
--- /dev/null
+++ b/dump/dist/meson.build
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: Apache-2.0
+
+systemd_dep = dependency('systemd', required: true)
+
+systemd_system_unit_dir = systemd_dep.get_variable(
+ pkgconfig: 'systemdsystemunitdir'
+)
+dist_conf_data = configuration_data()
+dist_conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
+
+# Service installation
+configure_file(
+ input: 'openpower-dump-monitor.service',
+ output: 'openpower-dump-monitor.service',
+ configuration: dist_conf_data,
+ install: true,
+ install_dir: systemd_system_unit_dir
+)
+
+# Symlinks for services
+systemd_alias = [
+ ['../openpower-dump-monitor.service',
+ 'obmc-host-startmin@0.target.wants/openpower-dump-monitor.service']
+]
+
+foreach service: systemd_alias
+ meson.add_install_script(
+ 'sh', '-c',
+ 'mkdir -p $(dirname $DESTDIR/@0@/@1@)'.format(
+ systemd_system_unit_dir, service[1]
+ ),
+ )
+ meson.add_install_script(
+ 'sh', '-c',
+ 'ln -s @0@ $DESTDIR/@1@/@2@'.format(
+ service[0], systemd_system_unit_dir, service[1]
+ ),
+ )
+endforeach
diff --git a/dump/dist/openpower-dump-monitor.service b/dump/dist/openpower-dump-monitor.service
new file mode 100644
index 0000000..c528c38
--- /dev/null
+++ b/dump/dist/openpower-dump-monitor.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=OpenPOWER Dump Monitor
+Wants=obmc-host-start-pre@0.target
+Before=obmc-host-start-pre@0.target
+After=xyz.openbmc_project.Dump.Manager.service
+
+[Service]
+ExecStart=/usr/bin/openpower-dump-monitor
+Restart=always
+Type=simple
+
+[Install]
+# WantedBy=obmc-host-startmin@0.target
\ No newline at end of file