systemd: add in-repo service file
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Change-Id: I7d565298e6f5b7b0ef75b43b04d503afaa4d2cd0
diff --git a/meson.build b/meson.build
index 6691345..901c4d8 100644
--- a/meson.build
+++ b/meson.build
@@ -77,6 +77,18 @@
install: true,
install_dir: get_option('bindir'))
+systemd = dependency('systemd')
+systemd_system_unit_dir = systemd.get_pkgconfig_variable(
+ 'systemdsystemunitdir',
+ define_variable: ['prefix', get_option('prefix')])
+configure_file(
+ copy: true,
+ input: 'pldmd.service',
+ install: true,
+ install_dir: systemd_system_unit_dir,
+ output: 'pldmd.service',
+)
+
subdir('tool')
if get_option('tests').enabled()
diff --git a/pldmd.service b/pldmd.service
new file mode 100644
index 0000000..3e97cc0
--- /dev/null
+++ b/pldmd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Phosphor PLDM Daemon
+Wants=mctp-demux.service
+After=mctp-demux.service
+Wants=mapper-wait@-xyz-openbmc_project-inventory.service
+After=mapper-wait@-xyz-openbmc_project-inventory.service
+
+[Service]
+Restart=always
+EnvironmentFile=/etc/default/pldmd
+ExecStart=/usr/bin/pldmd --verbose $VERBOSE
+
+[Install]
+WantedBy=multi-user.target