Add phosphor-ecc unit

add phosphor-ecc.service.in unit file

Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: I2672d755e2d7457d98c0cd0b4f660d82d75ba8af
diff --git a/meson.build b/meson.build
index 766f89b..30e2fd2 100644
--- a/meson.build
+++ b/meson.build
@@ -35,3 +35,12 @@
 configure_file(output : 'config.h',
                configuration : conf_data)
 
+systemd = dependency('systemd')
+conf_data = configuration_data()
+conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
+configure_file(
+  input: 'phosphor-ecc.service.in',
+  output: 'phosphor-ecc.service',
+  configuration: conf_data,
+  install: true,
+  install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'))
diff --git a/phosphor-ecc.service.in b/phosphor-ecc.service.in
new file mode 100644
index 0000000..12a0029
--- /dev/null
+++ b/phosphor-ecc.service.in
@@ -0,0 +1,14 @@
+[Unit]
+Description=phosphor ECC dbus
+Wants=phosphor-dbus-monitor.service
+After=phosphor-dbus-monitor.service
+
+[Service]
+ExecStart=@bindir@/ecc_main
+Restart=always
+SyslogIdentifier=phosphor-ecc
+Type=dbus
+BusName=xyz.openbmc_project.memory.ECC
+
+[Install]
+WantedBy=multi-user.target